Results 1 to 5 of 5
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add style - BaseStyle (Word2000+)

    I have been trapped by something I've known for years - When (as an end user) I create a new style, the dialog box clearly shows that the new style will be based on the style of the currently selected paragraph. (I think we're talking Word 2.0!).

    Last night I learned that a simple bit of code was producing apparently random results - creating a new style using VBA sometimes based the style on "Normal", sometimes on "Title", and so on.

    The attached document demonstrates the trick.
    I don't have a solution as yet. I'm offering a service whereby the user supplies a page layout template and I load it with fabricated styles.
    The .BaseStyle is going to depend on either (a) the implicit base using the selected paragraph or ( some user-specified style.
    Option (a) would depend, generally, on the style of the first paragraph of the document.
    Option ( would depend on my/their specifying a global base style.
    Attached Files Attached Files

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

    Re: Add style - BaseStyle (Word2000+)

    Is your post simply meant as an observation, or is there an implicit question?

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add style - BaseStyle (Word2000+)

    An observation. I searched the forums for BaseStyle etc and found no post so I thought I'd add one as "Traps For Young Players".
    Thanks for springing to attention!

  4. #4
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Add style - BaseStyle (Word2000+)

    On a related note (I think), any direct formatting that's been applied to the current selection may also "infect" your VBA-created style. See <!post=this thread,437,136>this thread<!/post>.

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add style - BaseStyle (Word2000+)

    >See this thread.
    Thanks St3333ve. Nice post!

Posting Permissions

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