Results 1 to 4 of 4

Thread: closing word

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Posts
    65
    I want to close a word doc or exit word in the normal way
    and NOT receive the 'do you want to save' prompt

    I know about 'wdDoNotSaveChanges', which I would like to
    use, but it won't work in 'Document.Close' or
    'AutoClose'

    This will work from a command button, but I want it to
    work from 'X' or 'File' - 'Close'

    Thanks in advance

  2. #2
    Lively Member
    Join Date
    Aug 2000
    Location
    South Africa
    Posts
    113
    what about trying application.quit.

    Not so sure what you trying to do but what about just savinbg the doc just before you close it. do the save and then closew word.
    also sometimes using sendkeys altf F$ = %{F4} is more stable

    You are living a pacifist dream, and if you dreaming it means you sleeping and you should damn well wake up!

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    if it works from a command button then just use the code from the button in the Querry Unload and Unload events of the form.

    The application quit using unsave should work. Try creating a macro to do what you want and then copy the macro code.

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    From Word start up the Visual Basic Editor and in the project window choose "This Document" and add the following code to the Close event:
    Code:
    Private Sub Document_Close()
        ActiveWindow.Close wdDoNotSaveChanges
    End Sub
    Good luck!

Posting Permissions

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



Click Here to Expand Forum to Full Width