I'm trying to loop through the pages of a document (for simplicity, say there are 5 pages) and do some tasks (for simplicity, say add a text box) on each page.
Using VBScript, my thoughts are that something like:
Set myPages = myDocument.Pages
i = 1
do until i > 5
set myTextFrame = myDocument.ActivePage.TextFrames.Add
myTextFrame.Contents = "Hello, World"
i = i + 1
But the best I can do (when I'm not getting syntax error messages) is to get the text written multiple times on one page.
I know that there's a simple fix that I'm missing.
You can't select a pages. Delete the line that has Select() in it, and replace the line after it with the following:
set myTextFrame = myDocument.Pages.Item(i).TextFrames.Add
You should probably add () after Add