Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2007

Tip: Looking for answers? Try searching our database.

Clear Style and Formatting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vbaNOOB - 09 Mar 2007 07:56 GMT
In MS word,

U clear formatting for the selected text by clicking the "Clear Formatting"
from the "Styles and Formatting" box
How can I achieve this in VBA

activedocument.paragraphs(1). ??
I cant find .clearFormatting

Thanks
Helmut Weber - 09 Mar 2007 08:15 GMT
Hi vbaNOOB,

clearformatting applies
to the find-, replace- and the selection-object.

Either you select the paragraph

or use

ActiveDocument.Paragraphs(1).Range.Font.Reset

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Helmut Weber - 09 Mar 2007 08:21 GMT
hmm,

you might have to reset the paragraphs style
to "normal" in addition.

Signature

Helmut Weber, MVP WordVBA

Klaus Linke - 11 Mar 2007 01:41 GMT
> hmm,
>
> you might have to reset the paragraphs style
> to "normal" in addition.

And if you want to replicate whatever Word does perfectly:
WordBasic.ClearFormatting

(I'm not sure what it does exactly, either)

Regards,
Klaus
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.