(VBA) Acrobat 类型库的后期绑定(避免引用)

(VBA) Late Binding (avaoid reference) of Acrobat Type Library

是否可以通过某种方式避免对 Adob​​e Acrobat 类型库的引用? 我不知道怎么...我收到了 ActiveX 错误消息。

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

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 谢谢!有效! (结果是我的代码摘录)。 我在某处读到应该将 "Const AcroExch As Long = 0" 放在 Dim 之后,为什么会这样?

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")