(VBA)Acrobat类型库的后期绑定(可用参考) [英] (VBA) Late Binding (avaoid reference) of Acrobat Type Library

查看:1174
本文介绍了(VBA)Acrobat类型库的后期绑定(可用参考)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以以某种方式避免引用Adobe Acrobat类型库? 我不知道如何...我收到ActiveX错误消息.

Is it possible to avoid the reference to the Adobe Acrobat Type Library somehow? I cannot figure it out how...I receive an ActiveX error message.

我只粘贴我的代码的一部分,因为其余部分并不那么重要. 这是具有早期绑定(设置参考)的代码:

I only paste an extract of my code as the rest is not that important. Here is the code with early binding (set up reference):

Dim Fol_Path As String
Dim Each_Page As Boolean

Dim AC_PD As Acrobat.AcroPDDoc
Dim AC_Hi As Acrobat.AcroHiliteList
Dim AC_PG As Acrobat.AcroPDPage
Dim AC_PGTxt As Acrobat.AcroPDTextSelect

Dim OS_FSO As Object
Dim OS_TxtFile As Object

Set OS_FSO = CreateObject("Scripting.filesystemobject")

Dim Ct_Page As Long
Dim i As Long, j As Long, k As Long
Dim T_Str As String

Dim Hld_Txt As Variant

Each_Page = True

Set AC_PD = New Acrobat.AcroPDDoc
Set AC_Hi = New Acrobat.AcroHiliteList
AC_Hi.Add 0, 32767

... ... ...

... ... ...

        Set AC_PG = .AcquirePage(i - 1)

        Set AC_PGTxt = AC_PG.CreateWordHilite(AC_Hi)

推荐答案

@ACatinLove 谢谢!有效! (我的代码提取为结果). 我读到某个地方应该在Dim后面加上"Const AcroExch As Long = 0",为什么会这样呢?

@ACatinLove thanks! It worked! (my code extract as the result). Somewhere I read that one should put "Const AcroExch As Long = 0" after Dim, why is so?

Dim AC_PD As Object
Dim AC_Hi As Object
Dim AC_PG As Object
Dim AC_PGTxt As Object

'Const AcroExch As Long = 0

Dim OS_FSO As Object
Dim OS_TxtFile As Object

Set OS_FSO = CreateObject("Scripting.filesystemobject")

Dim Ct_Page As Long
Dim i As Long, j As Long, k As Long
Dim T_Str As String

Dim Hld_Txt As Variant

Each_Page = True

'Set AC_PD = New Acrobat.AcroPDDoc
'Set AC_Hi = New Acrobat.AcroHiliteList

Set AC_PD = CreateObject("AcroExch.PDDoc")
Set AC_Hi = CreateObject("AcroExch.HiliteList")

这篇关于(VBA)Acrobat类型库的后期绑定(可用参考)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆