Public
Sub
ppddff()
Dim
gApp
As
Acrobat.CAcroApp
Dim
AvDoc
As
Acrobat.CAcroAVDoc
Dim
gPDDoc
As
Acrobat.CAcroPDDoc
Dim
FormApp
As
AFORMAUTLib.AFormApp
Dim
AcroForm
As
AFORMAUTLib.Fields
Dim
Field
As
AFORMAUTLib.Field
Dim
ORD
As
String
Dim
PRG
As
String
Dim
OPT
As
String
Dim
DAT
As
String
Dim
x
As
Boolean
Const
DOC_FOLDER
As
String
=
"K:\01 Portfoliomanagement\PM\03 Projekte\Fondstauschprogramm"
Set
gApp = CreateObject(
"AcroExch.App"
)
Set
gPDDoc = CreateObject(
"AcroExch.PDDoc"
)
Set
AvDoc = CreateObject(
"AcroExch.AVDoc"
)
Set
FormApp = CreateObject(
"AFormAut.App"
)
x = AvDoc.Open(DOC_FOLDER &
"\TEST.pdf"
,
"TEST"
)
AvDoc.Maximize (1)
For
Each
Field
In
FormApp.Fields
If
Field.Name =
"Name"
Then
Field.Value =
"XXXXX"
End
If
Next
ORD = "HKCR\Software\Adobe\Acrobat\Exe\"
If
ORD <>
""
Then
Set
oWSHShell = CreateObject(
"Wscript.Shell"
)
Set
oFs = CreateObject(
"Scripting.FileSystemObject"
)
PRG =
"C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe"
Set
oWSHShell =
Nothing
Set
oFs =
Nothing
Else
PRG =
""
End
If
OPT =
"/P /H /N"
DAT = DOC_FOLDER &
"\TEST.pdf"
If
Dir(DAT) <>
""
Then
If
Dir(PRG) <>
""
Then
Shell PRG & OPT & DAT, vbaMinimizedNoFocus
End
If
End
If
AcroApp.
Exit
Set
gApp =
Nothing
Set
gPDDoc =
Nothing
Set
AvDoc =
Nothing
End
Sub