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 / November 2007

Tip: Looking for answers? Try searching our database.

Add a Paragraph Style in W2007 vba

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KAM - 09 Nov 2007 19:06 GMT
I am trying to add a paragraph style though vba in Word 2007.

ActiveDocument.Styles.Add Name:="MINE", Type:=wdStyleTypeParagraph
OR
ActiveDocument.Styles.Add ("MINE")

Both ways apply the style as a CHARACTER style.

Can anyone tell me how to add a PARAGRAPH style in vba?
By the way, BOTH the above worked just fine in Word 2003.

AND, I am stuck adding the styles "manually" through code instead of using
.organizercopy since .organizercopy (in vba) does not want to work with a doc
if it is not saved locally!! Ughh!

Any help is greatly appreciated!
KAM - 09 Nov 2007 19:26 GMT
Nevermind: I have been able to locate that Word 2007 added 2 more types:
Original 4 Styles.add types:
wdStyleTypeCharacter
wdStyleTypeList
wdStyleTypeParagraph
wdStyleTypeTable

New 2 types for Styles.Add:
wdStyleTypeParagraphOnly
wdStyleTypeLinked

Once I changed type:= from wdStyleTypeParagraph to wdStyleTypeParagraphOnly,
it added the style as a PARAGRAPH style. I have no idea why
wdStyleTypeParagraph would not work.

(I still don't like Word2007)

And, when I went to the vba help for styles.add, it did NOT give me the
options available for type:=

> I am trying to add a paragraph style though vba in Word 2007.
>
[quoted text clipped - 12 lines]
>
> Any help is greatly appreciated!
 
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.