Results 1 to 8 of 8
  1. #1
    Star Lounger
    Join Date
    Nov 2001
    Location
    KS
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    More Template Tantrums.<br> (Word 2000)

    More Template Tantrums.
    I have created a Letterhead setup template document which sets up a two page letter, where the second page header inserts a date and page number and is different than the first page header. The template has different borders and setting than my default document setup. At the same time, the template has a correct page setup so that when I print, the printer pulls the first page from letterhead tray and all subsequent pages from the plain paper bin.
    I created a button macro on the toolbar that when I open a new default page and hit the button, it sets things up by inserting the template over my default document. When I do that, and check the document settings, somehow when doing the insert macro with the template, it switches the printer back to pulling all pages from the plain paper bin. I am lef t with either manually making the change or designing a second macro to make the change. Opting for the latter, when I run the second button macro, I get a debug error message and, upon checking, the following highlighted line:
    With ActiveDocument.PageSetup
    .LineNumbering.Active = False <img src=/S/crybaby.gif border=0 alt=crybaby width=15 height=15>

    I have no idea why toggling off the line numbering would cause an error. I used to do C-Basic programming and it was easier than simply doing a copycat Word Macro!! Anyone have a work-around suggestion or some ideas for a fix?

  2. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: More Template Tantrums.<br> (Word 2000)

    <img src=/w3timages/blackline.gif width=33% height=2>
    > I get a debug error message
    <img src=/w3timages/blackline.gif width=33% height=2>

    What was the error message?
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  3. #3
    Star Lounger
    Join Date
    Nov 2001
    Location
    KS
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: More Template Tantrums.<br> (Word 2000)

    The error message was:
    Run Time Error '4608'
    Value out of range

  4. #4
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: More Template Tantrums.<br> (Word 2000)

    I'm not sure what you mean by "inserting the template over my default document." What you would want the button (which should be stored in a global template other than normal.dot) to do is create a new document based on your template. If you want it to close the current document first, you can have it do that.

    This is much simpler than trying to import all the components of one template into a document based on a different template.

    You can have your printer settings in the page setup definitions in your template. Again, these settings are easy to use when creating a new document based on your template, very difficult to copy into a different document.

    That way your macro is simply:

    Word.Document.Add Template:="MyTemplate.dot"
    Charles Kyle Kenyon
    Madison, Wisconsin

  5. #5
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: More Template Tantrums.<br> (Word 2000)

    I have exactly the same error -doing exactly the same thing.

    Did you manage to find a fix or a workaround?

    Thanks in advance.

    Robie
    Thanks.
    Robie

  6. #6
    Star Lounger
    Join Date
    Nov 2001
    Location
    KS
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: More Template Tantrums.<br> (Word 2000)

    I've not heard from anyone who indicates what the error message means.

  7. #7
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: More Template Tantrums.<br> (Word 2000)

    I don't know if any of this will help, but ...
    1. <LI>Are you actually using the linenumbering? If not, just remove the line of code; Word will then use the default, which is off.
      <LI>On looking up line numbering in the help, I notice it says you have to be in page layout view to see the numbering - I don't know if anything to do with this might be causing it?
      <LI>I have sometimes got an error message before when telling Word to switch something off (or on) that was already off (or on) - if you're not using linenumbering (but want to keep the line of code - see 1. above) try something like "if ActiveDocument.PageSetup.LineNumbering.Active <> False then ActiveDocument.PageSetup.LineNumbering.Active = False" - seems weird, I know but it's worked before!
    Hope something helps!
    Beryl M


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

    Re: More Template Tantrums.<br> (Word 2000)

    The 'LinesPage' parameter of the ActiveDocument.PageSetup was totally crap in my case & I just set to something sensible and it all worked fine afterwards. (Obviously WORD does not initialise all of the values - d'oh!).

    With ActiveDocument.PageSetup
    .LinesPage = 52 ' I added this line and then it just worked fine.
    .LineNumbering.Active = False
    .Orientation = wdOrientPortrait
    .TopMargin = InchesToPoints(1.03)
    .BottomMargin = InchesToPoints(1.03)
    .LeftMargin = InchesToPoints(1.93)
    .RightMargin = InchesToPoints(2.04)
    .Gutter = InchesToPoints(0)
    .HeaderDistance = InchesToPoints(0.59)
    .FooterDistance = InchesToPoints(0.39)
    .PageWidth = InchesToPoints(8.5)
    .PageHeight = InchesToPoints(11)
    .FirstPageTray = wdPrinterDefaultBin
    .OtherPagesTray = wdPrinterDefaultBin
    .OddAndEvenPagesHeaderFooter = True
    .DifferentFirstPageHeaderFooter = False
    .VerticalAlignment = wdAlignVerticalTop
    .SuppressEndnotes = False
    .MirrorMargins = False
    .TwoPagesOnOne = False
    '.GutterPos = wdGutterPosLeft
    End With

    Hope this helps.
    Thanks.
    Robie

Posting Permissions

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