C
Cory
I am experimenting in Publisher 2007. I created a Textbox Shape
programmatically and named it "MyText". I then Inserted a new page (via the
GUI and duplicated everything on the first page (MyText was the only thing
there). Using another macro I checked that the text box on Page 2 is in fact
named MyText.
The statements :
Dim vNewText as String
vNewText = "Newer Text"
ActiveDocument.Pages(1).Shapes("MyText").TextFrame _
.TextRange.Text = vNewText
change the text in the text box on Page 1 however, when changing Pages(1) to
Pages(2) (In effect referring to an identical textbox on a different page) I
Get Runtime Error '9' Suscript out of range.
The only KB articles that had anything to do with this talked about
referring to color styles that could not be referenced programmatically, and
doing so would result in the above error, but the similarities end there.
Cory
programmatically and named it "MyText". I then Inserted a new page (via the
GUI and duplicated everything on the first page (MyText was the only thing
there). Using another macro I checked that the text box on Page 2 is in fact
named MyText.
The statements :
Dim vNewText as String
vNewText = "Newer Text"
ActiveDocument.Pages(1).Shapes("MyText").TextFrame _
.TextRange.Text = vNewText
change the text in the text box on Page 1 however, when changing Pages(1) to
Pages(2) (In effect referring to an identical textbox on a different page) I
Get Runtime Error '9' Suscript out of range.
The only KB articles that had anything to do with this talked about
referring to color styles that could not be referenced programmatically, and
doing so would result in the above error, but the similarities end there.
Cory