Clear Style and Formatting

V

vbaNOOB

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
 
H

Helmut Weber

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

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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

Helmut Weber

hmm,

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

Klaus Linke

Helmut Weber said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top