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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT Plea! Runtime Error 5917: Object does not support attached text

Status
Not open for further replies.

sugarflux

Technical User
Joined
Aug 14, 2003
Messages
111
Location
GB
Hi

Please help!
I'm creating a procedure to loop through thousands of word documents searching in the Header, footer and body for certain symbols and fonts to change them for others.

Part of the procedure looks for 'textboxes' in the header and checks the text in the textbox for the symbols and font i'm searching for.

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader

If Selection.HeaderFooter.Shapes(myShape).TextFrame.TextRange.Font.Name = "LogoFont" Then

This is the line thats producing the above error. The above statement should be TRUE as the textbox font is 'LogoFont'

Please help urgently!
Thanks
sugarflux
Word 2000
 
I've now solved this problem myself but thought i would post the solution in case it would be usefule to someone else!

The textbox was grouped with a drawing object that did not have text.

I used
If selection.shapes(myShape).type.hastext = true then

to confirm that the shape had text. If not, i checked for grouping and looped through each of the shapes in the document.

sugarflux
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top