View Single Post
 
Old 07-20-2011, 02:55 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Peter,

Removing the 'With' 'End With' and having 'Selection.Style = "Normal"' means the Style gets applied to the document! If you delete the 'With' 'End With', you merely make the code less efficient and you also need to use 'Shp.TextFrame.TextRange.Style = "Normal"'.


I note too that you've deleted the code that defines and sets the Rng variable. That'll cause problems when you get to 'Rng.Select'. Failure to collapse the Selection is also liable to cause problems when you use 'Selection.Paste' after '.Anchor.Cut'.

When you run the unmodified code, per post #6 above, what is selected? Is it text in the body of the document, or something else?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote