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!