I would like to put 7 fields on every page of the document. However I seem to be only able to put fields on the first page.
CurrentPage takes me to the page but when I CreateObject it still creates the Textbox on the first page.
This is the code I have written which does not work:
With Me.pdfCreator
For ii = 1 To .PageCount
.CurrentPage = ii
For i = 1 To 7
.CreateObject acObjectTypeText, "Unlicensed " & i
.ObjectAttribute("Unlicensed " & i, "Top") = 2000 * i
.ObjectAttribute("Unlicensed " & i, "Left") = 200
.ObjectAttribute("Unlicensed " & i, "Right") = 6000
.ObjectAttribute("Unlicensed " & i, "Text") = "Not registered!"
.ObjectAttribute("Unlicensed " & i, "TextColor") = &HFF
.RedrawObject "Unlicensed " & i
Next
Next
End With
Create a TextBox on the 2nd or 3rd page using VB
Hello,
Please look at the code below. This will resolve your issue.
Private Sub cmdAddSevenItems_Click()
Dim iCtrPage As Integer
Dim iCtrObj As Integer
iCtrPage = 1 'start at page 1
PDF1.SetLicenseKey LicenseTo, ActivationCode
With PDF1
For iCtrPage = 1 To 7
For iCtrObj = 1 To 7
.CreateObject acObjectTypeText, "Unlicensed " & iCtrObj
.ObjectAttribute("Unlicensed " & iCtrObj, "Top") = 2000 * iCtrObj
.ObjectAttribute("Unlicensed " & iCtrObj, "Left") = 200
.ObjectAttribute("Unlicensed " & iCtrObj, "Right") = 6000
.ObjectAttribute("Unlicensed " & iCtrObj, "Text") = "Not registered!"
.ObjectAttribute("Unlicensed " & iCtrObj, "TextColor") = &HFF
Next
If iCtrPage <= 6 Then
.AddPage iCtrPage
End If
Next
'This fucntion enables the changes
.DoCommandTool (acCommandToolRunDocument)
.Save "c:\temp\sevepages_7.pdf", 0
End With
End Sub
Hope this helps
Please look at the code below. This will resolve your issue.
Private Sub cmdAddSevenItems_Click()
Dim iCtrPage As Integer
Dim iCtrObj As Integer
iCtrPage = 1 'start at page 1
PDF1.SetLicenseKey LicenseTo, ActivationCode
With PDF1
For iCtrPage = 1 To 7
For iCtrObj = 1 To 7
.CreateObject acObjectTypeText, "Unlicensed " & iCtrObj
.ObjectAttribute("Unlicensed " & iCtrObj, "Top") = 2000 * iCtrObj
.ObjectAttribute("Unlicensed " & iCtrObj, "Left") = 200
.ObjectAttribute("Unlicensed " & iCtrObj, "Right") = 6000
.ObjectAttribute("Unlicensed " & iCtrObj, "Text") = "Not registered!"
.ObjectAttribute("Unlicensed " & iCtrObj, "TextColor") = &HFF
Next
If iCtrPage <= 6 Then
.AddPage iCtrPage
End If
Next
'This fucntion enables the changes
.DoCommandTool (acCommandToolRunDocument)
.Save "c:\temp\sevepages_7.pdf", 0
End With
End Sub
Hope this helps