Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jul 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Save to A: (Word 2000)

    In Corel Word Perfect 8 there was a very handy feature that would save your current document in its location and at the same time save a copy to a disk. Is there an easy way to accomplish this in Word? I am inexperienced with VBA, and when I tried to create something, I failed miserably. Thanks in advance.

  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: Save to A: (Word 2000)

    There is a minor problem with this. <img src=/S/grin.gif border=0 alt=grin width=15 height=15> Windows does not let you copy a file that is open in Word, and using SaveAs will change the destination of the active file. So... what to do.

    You can create a new document based on an open file the same way that you can create a new document from a shared template. However, this might be hard to hide from view. I think it's possible, but I don't have time to test this extensively at the moment:

    <pre>Sub FileSave()
    ActiveDocument.Save
    MirrorFile ActiveDocument, "c:testing"
    End Sub

    Sub MirrorFile(docBackMeUp As Document, strDestFolder As String)
    'Requires Word 2000 / VB6 or higher for InStrRev
    If Dir(strDestFolder, vbDirectory) = vbNullString Then
    MkDir strDestFolder
    End If
    ' should test for trailing but not today
    Dim docClone As Document
    Set docClone = Documents.Add(Template:=docBackMeUp.FullName, NewTemplate:=False, _
    Visible:=False)
    docClone.SaveAs FileName:=strDestFolder & Right(docBackMeUp.FullName, _
    Len(docBackMeUp.FullName) - InStrRev(docBackMeUp.FullName, "") + 1)
    docClone.Close
    Set docClone = Nothing
    End Sub</pre>

    Footnote: You could create FileSaveAs, FileClose, etc., macros that also call MirrorFile.

    Since lots of error conditions are possible, from a missing floppy disk to a too-big file, you would need to add a lot of error trapping to make this friendly.

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save to A: (Word 2000)

    For an alternative method, that won't require VBA, you can save & close your file, then go to File/Open... It will be open to the correct folder as you've just finished saving & closing it. Right click the file & choose SendTo & send it to the floppy drive.
    Cheers,

  4. #4
    4 Star Lounger
    Join Date
    Oct 2001
    Location
    New York, New York, USA
    Posts
    538
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Save to A: (Word 2000)

    Evening -

    I have never had a probelm with saving a Word doc that was open, either via File/Open or via Windows Explorer. I remember that first time I read it couldn't be done I was rather stunned: have been doing it for years and yes, it is the mostly recent saved file.

    Hope this saves someone time and clicks.

    Curious

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save to A: (Word 2000)

    You can only save an open file. I've never had a problem copying an open file, if that's what you meant. However, if you are currently editing an open file & copy it (via File/Open, SendTo, Explorer) you will only copy the file as it existed up to the last save, so it's better to save or save/close before you copy.
    Cheers,

Posting Permissions

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