Results 1 to 3 of 3
  1. #1

    Saving Word Files With Variable Extensions (Word 2000)

    In testing templates for quality assurance, I need to temporarily

  2. #2
    Join Date
    Jan 2001
    Slough, Berkshire, England
    Thanked 0 Times in 0 Posts

    Re: Saving Word Files With Variable Extensions (Word 2000)


    Sub mjaQuickSave()
    Dim stFile as String
    dim iCount as Integer
    iCount = 0
    stFile = "C:My DocumentsQA Testingmja" & Format(Date, "mmddyy") & ".doc"
    do until dir(stFile)=""
    stFile = "C:My DocumentsQA Testingmja" & Format(Date, "mmddyy") & "-" & format (icount,"000")& ".doc"
    icount = icount +1

    ActiveDocument.SaveAs FileName:=stFile
    End Sub

    The program carries out a directory command to see if the file exists, if it does not then the DIR command returns "" and the loop finishes and the file is saved. If the file does exist, it changes the file name and tries again, soing so until it has a name that is not in use.

    I have added a two digit number rather than a letter as it is easier to code and gives you more filenames.

    I hope this helps

  3. #3

    Re: Saving Word Files With Variable Extensions (Word 2000)

    You are brilliant! I just tested your code and it works exactly like I wanted, and even better in that it gives expansion to saving many temporary files on same day! Thank you so much for the quick response, and for your most efficient code! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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