Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Feb 2001
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    AutoNew Macro (Word 2000 SR-1 )

    I have instructions for a macro that I copied from somewhere (don't remember where), but I can't get it to work. Can someone tell me why I get Expected End Sub errors, please? Here's the instructions I cut and pasted.

    Choose Tools - Macro - Macros and type in AutoNew.
    Click the arrow at the right side of the Macros Available In box and choose Normal.dot template.
    Click on Create and type in the macro exactly as shown between Sub MAIN and End Sub:

    Sub MAIN
    FName$ = InputBox$("What do You Want to Name This File?", "New File")
    FileSaveAs .Name = FName$, .Format = 0
    End Sub

    Is Sub Main also part of the macro after you name it AutoNew? Thanks in advance for any help you can give me.

    Cheri

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: AutoNew Macro (Word 2000 SR-1 )

    Each macro must have exactly one pair of these:

    Sub MacroName
    ...
    End Sub

    If you have Sub AutoNew at the beginning of your procedure, and Sub MAIN "inside" the Sub/End

  3. #3
    New Lounger
    Join Date
    Feb 2001
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoNew Macro (Word 2000 SR-1 )

    Thanks. I figured that could be the problem, but now I get an error message - invalid or unqualified reference - on the .Name portion of the macro. All I'm trying to do is a Save and get a prompt to name my doc.

    Thanks again.
    Cheri

  4. #4
    Star Lounger
    Join Date
    Mar 2002
    Location
    North Carolina, USA
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoNew Macro (Word 2000 SR-1 )

    I think the code example you have is the way it would have been written in WordBasic (what Word 6 and Word 95 used). Try changing your line beginning "FileSaveAs .." to read:

    ActiveDocument.SaveAs FName$, wdFormatDocument

    and see if the macro works.

  5. #5
    New Lounger
    Join Date
    Feb 2001
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoNew Macro (Word 2000 SR-1 )

    Oh, is that cool! You were right! Thank you, thank you, thank you!

    cheri

Posting Permissions

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