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 2004

Tip: Looking for answers? Try searching our database.

How to get the number style?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DorisTan - 03 Nov 2004 10:28 GMT
Hi, i am using vb to read a xxx.doc (microsoft word) and analyst th
style of each paragraph. For example, in my doc, i have the paragrap
below:

1. This is my document.
a. Something is written in this paragraph.
i. first point.
ii. second point.
b. Another paragraph here.
2. My document.

in my vb code, i would like to know what is the style's name of 1, 2
3.. a, b, c... i, ii, iii... (i am not really sure if its calle
wdListNumberStyleLowercaseRoman or something...)
i have found that the code below list down the styles of the document.

for i = 0 to 9
msgbox WordDoc.ListTemplates(1).ListLevels(i).NumberStyle
next

but my problem is, i want to know the NumberStyle in each paragraph
and hence do something, i have tried for many ways but i still faile
to get what i want. hope someone can help.really need your help here
thank you

--
Message posted from http://www.ExcelForum.com
Klaus Linke - 04 Nov 2004 20:47 GMT
> but my problem is, i want to know the NumberStyle in each paragraph,

Hi Doris,

For the first paragraph in the selection:

Dim i
With Selection.Paragraphs(1).Range.ListFormat
 i = .ListLevelNumber
 MsgBox "Number style: " & _
 .ListTemplate.ListLevels(i).NumberStyle, _
 vbInformation, _
 "ListLevel: " & i
End With

Perhaps you can find some more info in
http://word.mvps.org/faqs/numbering/ListString.htm by Dave Rado.

Regards,
Klaus
DorisTan - 08 Nov 2004 05:00 GMT
Thanks klause, you gave me a perfect guide, below is my solution to m
problem:

Dim i
With Selection.Paragraphs(1).Range.ListFormat
i = .ListLevelNumber
If parCounter.Range.ListFormat.ListTemplate.ListLevels(i).NumberStyle
wdListNumberStyleLowercaseRoman then

msgbox "This is Lower Case Roman"

end if
End With

Thank you very much :)
regards;
Dori

--
Message posted from http://www.ExcelForum.com
 
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.