Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Aug 2003
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    saving Word doc (word 97, word 2000)

    I am trying to save a document with a different file name every time i save, but if the document already exists i get a error message. I am using the following code to save the document
    With Dialogs(wdDialogFileSaveAs)
    .Name = "C:" & ll_cnt & " Draft"
    .Show
    End With

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

    Re: saving Word doc (word 97, word 2000)

    What error message do you get? If I try this, the document gets overwritten without asking.

  3. #3
    Lounger
    Join Date
    Aug 2003
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: saving Word doc (word 97, word 2000)

    I am sorry i did not explain it right.. If you have the said document open and you try to save it again with the same filename it gives me an error. Also how can i specify to save the activedocument with the code
    With Dialogs(wdDialogFileSaveAs)
    .Name = "C:" & ll_cnt & " Draft"
    .Show
    end with
    That is how can i specify the above with... endwith to work for the activedocument..

    Thanks...

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: saving Word doc (word 97, word 2000)

    By using Dialogs and Show, you give the user the chance to specify the name. It is applied to the active document by definition. If you just want to save the document under another name without user intervention, use

    ActiveDocument.SaveAs FileName:="C:" & ll_cnt & " Draft"

    If a document of that name already exists, it should be overwritten without error message, unless the document is read-only or open in another application when you try to save it.

  5. #5
    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: saving Word doc (word 97, word 2000)

    <P ID="edit" class=small>(Edited by jscher2000 on 03-Sep-03 01:02. Found the thread.)</P>I posted a macro either on this or on the Word board a few weeks back that created a new file each time you save a document. I have to reboot now or I'd look for it in my e-mail archives. See if you can find it.

    Added: See <post#=283508>post 283508</post#>. Does that help?

Posting Permissions

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