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

Help needed in Styles and Formating

Status
Not open for further replies.

engrfurqan

Programmer
Jan 5, 2009
20
I want to go through with all the formatting in use in a word document and collect some description i am using the following code but it is not working

sub test()
dim sty as style
for each sty in activedocument.styles
if sty.inuse = true the
msgbox(sty.font.name)
end if
next
end sub

this program gives the name times new roman but im using some other fonts.

Regards,
Furqan
 
Then you have done manual formatting.

These - even though you can see things like "Normal + Arial + Bold" in the Style dropdown - are NOT styles, and will NOT be found via code. They are NOT part of the ActiveDocument.Styles collection.

Solution? Do not use manual formatting.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top