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

    Macro to save, close, open new doc (Word 2000 SR-1 )

    I'm just learning macros and having a difficult time getting a simple macro to save the current file, close it, then open a new blank document. What am I doing wrong, please?

    Sub MAIN
    FileSave FileClose FileNew
    End Sub

    Thanks!

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Macro to save, close, open new doc (Word 2000 SR-1 )

    Cheri,

    In its simplest form, it would probably look something like this:

    Public Sub SaveCloseCurrentDoc_CreateNewDoc()
    ActiveDocument.Close wdSaveChanges
    Documents.Add
    End Sub

    HTH,
    Gary

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

    Re: Macro to save, close, open new doc (Word 2000 SR-1 )

    Gary, it works perfectly! Thanks so much!

    Cheri

  4. #4
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro to save, close, open new doc (Word 2000 SR-1 )

    <hr>Sub MAIN
    FileSave FileClose FileNew
    End Sub<hr>

    I guess you have a book on WordBasic? The macro language of Word changed from WordBasic to VBA between Word6 and Word95.

    The two languages are very different. With the next version (Word2004?), the language will change again (to VB.NET), but this will not be as big a change.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Klaus

Posting Permissions

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