I know I can read in all the objects on a page and cycle through them to see if any of them have the right name, but is there a more efficient way to check if an object exists before attempting to update it?
If PDF1.ObjectAttribute(acObjectTypeText, "name1") <> "" Then
'Make the Needed changes to the Object
PDF1.ObjectAttribute("name1", "Text") = "new text"
Else
Call DebugTextBox("Object Not found")
End If
I am still getting problems with that code. I'm not sure I have the first line right or what exactly you meant by it.
Dim CreatorRef As New ACPDFCREACTIVEX.PDFCreactiveX
Dim obj As New ACPDFCREACTIVEX.acObject
Private Sub GetObject_Click()
With CreatorRef
.Open inDirectory + "simplePDF.pdf", ""
.SetLicenseKey Licensee, ActivationCode
Set obj = .GetObjectByName("acText1")
If obj Is Nothing Then
MsgBox "Unable to find object"
Else
MsgBox "Object found"
End If
End With
End Sub