Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Nov 2002
    Location
    London, Gtr London, England
    Posts
    492
    Thanks
    8
    Thanked 0 Times in 0 Posts

    variable, concatenation and word constants (Word 2K)

    I have a subroutine that loop round defining the heading styles in a template. The outline level is usally defined using the constants wdOutlineLevel1 to wdOutlineLevel9, I want to contruct this in this way:

    .OutlineLevel = WdOutlineLevel & xxStyleNumber

    where xxStyleNumber is the subscript controling the For Next loop and identifying the heading number (1 to 9).
    But this doesn't work, I get a type mismatch with the ampersand highlighted.
    I have tried several alternatives including using interim variables to construct the name but haven't yet hit on the right combination. any ideas?

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

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

    Re: variable, concatenation and word constants (Word 2K)

    wdOutlineLevel1 is the name of a symbolic constant, it is not a string "wdOutlineLevel1"

    Fortunately, the solution in this case is very simple. A quick look at the Object Browser shows that wdOutlineLevel1 = 1 etc. So you can use

    .OutlineLevel = xxStyleNumber

  4. #3
    4 Star Lounger
    Join Date
    Nov 2002
    Location
    London, Gtr London, England
    Posts
    492
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: variable, concatenation and word constants (Word 2K)

    Hans,

    that's twice in two days you've helpd!!!! thanks for this an all you time put into this site

    liz

Posting Permissions

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