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 / April 2005

Tip: Looking for answers? Try searching our database.

Reading info from styles

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jb - 05 Apr 2005 12:16 GMT
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
Chuck - 05 Apr 2005 16:49 GMT
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

> Hi Folks,
>
[quoted text clipped - 9 lines]
>
> J
jb - 11 Apr 2005 11:04 GMT
> 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
[quoted text clipped - 43 lines]
>>
>>J

Thanks Chuck, Worked well for me.

Cheers
J
 
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.