I'm currently using the following to edit a publisher document using access VBA.
Code:For Each pubShape In pubDoc.Pages(1).Shapes If pubShape.HasTextFrame Then If pubShape.Name = "Text Box 440" Then pubShape.TextFrame.TextRange.Text = Item1 If pubShape.Name = "Text Box 441" Then pubShape.TextFrame.TextRange.Text = Item2 If pubShape.Name = "Text Box 442" Then pubShape.TextFrame.TextRange.Text = Item3 If pubShape.Name = "Text Box 443" Then pubShape.TextFrame.TextRange.Text = Item4 If pubShape.Name = "Text Box 444" Then pubShape.TextFrame.TextRange.Text = Item5 If pubShape.Name = "Text Box 445" Then pubShape.TextFrame.TextRange.Text = Item6 If pubShape.Name = "Text Box 446" Then pubShape.TextFrame.TextRange.Text = Item7 If pubShape.Name = "Text Box 447" Then pubShape.TextFrame.TextRange.Text = Item8 End If Next
Obviously there are a lot of shapes/boxes etc in the document and this code is very inefficient and takes a few moments to complete. Is there a way to directly reference a text box and change its value. For word I have been using bookmarks but this doesn’t seem to work with publisher.
I’m looking for something like pubshape.Value(“text Box 440”) = Item1 but cannot find the correct syntax.