Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Style Desc to Code (Word 97SR2)

    I want to re-create in code a manually created style. The description of the style is

    Normal + Font: 9 pt, Bold, Border: Bottom(Double solid lines), Border spacing: 1 pt, Tabs: 7.5" right flush

    (from activedocument.Styles("P-Heading-Letter1").Description)

    Converting this to code, I'm still missing the Border Spacing part. Can you help?

    Set aStyle = ActiveDocument.Styles.Add(Name:="P-Heading-Letter1", Type:=wdStyleTypeParagraph)
    With aStyle
    .BaseStyle = "Body Text"
    .Font.Size = 9
    .Font.Bold = True
    .Borders(wdBorderBottom).LineStyle = wdLineStyleDouble
    .ParagraphFormat.TabStops.Add Position:=InchesToPoints(7.5), Alignment:=wdAlignTabRight
    ?????
    End With

    If you've spotted an error in the above please point it out as well.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Style Desc to Code (Word 97SR2)

    The Borders collection object has properties DistanceFromTop, DistanceFromBottom, DistanceFromLeft and DistanceFromRight. All are measured in points. So in your code, you can replace ????? by

    <font face="Georgia">.Borders.DistanceFromBottom = 1</font face=georgia>

    The rest of your code is OK as far as I can see.

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Style Desc to Code (Word 97SR2)

    Thanks Hans.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •