View Single Post
 
Old 04-16-2023, 11:00 PM
Dimsok Dimsok is offline Windows XP Office 2007
Advanced Beginner
 
Join Date: Sep 2014
Location: exUSSR
Posts: 50
Dimsok is on a distinguished road
Default Copy document to a few places

I have such code for copy document to root C
Code:
Sub FileCopyToС()
    OrigLongFileName = ActiveDocument.Name
    OldPath = ActiveDocument.Path & Application.PathSeparator
        Documents(ActiveWindow.Caption).Close
        FileCopy OldPath & OrigLongFileName, "C:\" & OrigLongFileName
        Documents.Open FileName:=OldPath & OrigLongFileName
        Application.GoBack
End Sub
How to change it (or create new), that documents will copy without closing and opening? I want to make backups to few places (with replacing old on that pathes). For example, from "C:\My doc\File.docx" to such pathes: "F:\My doc\File.docx" "G:\My doc\File.docx" "H:\My doc\File.docx" "H:\My doc\File.docx". But don't want see everytime during it 4 times closing and opening active document. Is it possible to copy current document silently? Don't see anything during coping, just like in normal saving.
Reply With Quote