Re: Reading info from styles by jb
jb
Mon Apr 11 05:04:16 CDT 2005
Chuck wrote:
> Not sure this is quick or dirty really, because from what I understand you've
> got to pull the settings out individually. Still you loop through tabs for
> their settings and pull other information out thusly (this isn't exhaustive,
> it gives you an idea of what needs to be done). Unfortunately, the values
> returned are index values, not descriptive strings, so you'll have to figure
> out what index means what yourself, unless someone else has a better idea:
>
> Dim strStyle As String
> Dim i As Long
> Dim strAlignment As String
> Dim strLeader As String
> Dim strBorderLeft As String
>
> strStyle = Selection.Style
>
> With ActiveDocument.Styles(strStyle).ParagraphFormat
>
> 'Tab settings
> For i = 1 To .TabStops.Count
> With .TabStops(i)
> MsgBox "Tab at position " & PointsToInches(.Position) & _
> " alignment is " & .Alignment & _
> " and leader is " & .Leader
> End With
> Next i
>
> 'Border settings
> strBorderLeft = .Borders(wdBorderLeft).LineStyle
> MsgBox "Left border is " & strBorderLeft
>
> 'etc you get the idea
>
> End With
>
>
>
> "jb" wrote:
>
>
>>Hi Folks,
>>
>>I'm trying to find a quick and dirty way of reading the Tab information
>>(Alignment & leader), Bullet information (whether bulleted, Numbered or
>>Outline Numbered and all the customizations) and Border settings from a
>>style.
>>
>>Any pointers, Especially on the Tab and Numbering, would be grately
>>appreciated.
>>
>>Thanks
>>
>>J
>>
Thanks Chuck, Worked well for me.
Cheers
J