Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting a TextBox from a header in MSWord

Status
Not open for further replies.

Bulldog91

MIS
Dec 13, 2001
1
0
0
US
I have a macro creating a textbox on every page that a user requires. I also want to have the option to delete that same textbox from every page. I can't seem to figure out the code to do that. I recognize that Word gives the textbox a name ("TextBox 1"), and it changes the name for the next page to "TextBox 2" and so on, but does anybody know the quick way to find that using VBA and having it loop to find it on whatever number of pages the document might be? Any help would be appreciated. Thanks.
 
Text boxes are Shapes.

Dim shp As Shape

With ActiveDocument

For Each shp In .Shapes
shp.Select
Selection.Collapse wdCollapseStart
Debug.Print shp.Name & " is on Page " & Selection.Information(wdActiveEndPageNumber)
Next
End With

M :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top