Sub
PDF_Formular()
Dim
Datei, Pfad, Name, CustName
As
String
Set
AcroApp = CreateObject(
"AcroExch.App"
)
Set
AvDoc = CreateObject(
"AcroExch.AVDoc"
)
Datei =
"D:/Test/Test.pdf"
Pfad =
"D:/Test/neu/"
If
AvDoc.Open(Datei, Name)
Then
AcroApp.Show
Set
PDDoc = AvDoc.GetPDDoc()
Set
jso = PDDoc.GetJSObject
If
ActiveSheet.Range(
"B2"
).Value =
"j"
Then
jso.getField(
"CustomerName"
).Value = ActiveSheet.Range(
"A2"
).Value
CustName = ActiveSheet.Range(
"A2"
).Value
Name = CustName &
".pdf"
PDDoc.Save PDSaveLinearized, Pfad & Name
End
If
PDDoc.Close
AvDoc.Close (
True
)
AcroApp.Hide
AcroApp.
Exit
Set
AcroApp =
Nothing
Set
AvDoc =
Nothing
Set
PDDoc =
Nothing
Set
jso =
Nothing
Else
MsgBox
"Dokument nicht gefunden!"
Set
AcroApp =
Nothing
Set
AvDoc =
Nothing
Set
PDDoc =
Nothing
Set
jso =
Nothing
End
If
End
Sub