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