Mirroring Documents

Written by Allen Wyatt (last updated November 22, 2022)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


2

Sarah has a document that she needs to save in two different folders on her system. She wonders if there is a way to have any updates to one copy of the document be automatically reflected in the other copy of the document.

There are actually several ways you can approach this problem. One is to create a macro that actually saves the document into two locations. Here is an example of a macro that does that.

Sub DualSave()
    Dim FirstFolder As String
    Dim SecondFolder As String
    Dim DocName As String
    Dim objF As Object
    Dim retVal As Long

    SecondFolder = "c:\MyLocation\"

    With ActiveDocument
        If Not .Saved Then
            .Save
            FirstFolder = .Path & "\"
            DocName = .Name
            If FirstFolder = SecondFolder Then
                MsgBox "WARNING! Second folder is the same as first folder."
                Exit Sub
            End If

            Set objF = CreateObject("Scripting.FileSystemObject")
            retVal = -1
            On Error Resume Next
            retVal = objF.CopyFile(FirstFolder & DocName, _
              SecondFolder & DocName, True)
            On Error GoTo 0
            Set objF = Nothing
            If retVal <> 0 Then
                MsgBox "File could not be copied to folder " & SecondFolder
            End If
        End If
    End With
End Sub

Such a macro is rather simplistic, in that it copies from where you are now to a second folder (specified in the SecondFolder variable). That means that if you open up the document in the second folder and then save it, the original document is not updated and running the DualSave macro will generate an error. (The error occurs because the first and second folder names will be the same.) For this reason, a macro approach such as this is more suitable if you want to copy to a second location as a way to make backups of your documents. An add-in created by Word MVP Graham Mayor does essentially the same thing:

https://www.gmayor.com/SaveInTwoPlacesAddIn.htm

Another approach (that doesn't require a macro) is to create your main document and then create the mirror document by using the "Paste Link" capabilities of Word. You simply select the entire first document and then use, within the mirror document, Paste Link to paste the information. The result is that the mirror document always reflects whatever is in the main document. (Additional information on how to link Word documents is presented in other WordTips.) The drawback is that you cannot make changes in the mirror document and have those reflected in the main document; the mirroring is only in one direction.

Perhaps the best solution, however, is to not rely on Word at all. Instead, save your main document and, in Windows, create a shortcut to that main document. Move the shortcut to the second folder, and you are ready. Now someone can open either the original document or the shortcut, and it will always refer to the same document. To create the shortcut, do the following:

  1. Save your document and exit Word completely.
  2. Locate and right-click the document file you just saved. Windows displays a Context menu.
  3. Choose Create Shortcut. The shortcut is placed in the same folder as the original document.
  4. Open a window for the second folder.
  5. Drag the shortcut from the first folder to the second folder.

Your shortcut is now in place. If you double-click it, Word opens the original document. You now essentially have a single document accessible through two different folders. The drawback to this approach, of course, is that the second folder only contains a shortcut to the original document, which means you should not consider the shortcut as a backup of the original document; it isn't. If you are actually looking for a way to make backup copies of documents, then use one of the other solutions discussed in this tip.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12633) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Viewing Footnotes and Endnotes

Footnotes and endnotes are normally visible with the rest of your document, but such visibility is dependent on which ...

Discover More

Spell-checking Uppercase Words

Excel's spell-checker normally checks uppercase words for spelling. If your worksheet contains a lot of acronyms, you ...

Discover More

Using Outline Numbering in a Table

Can you put a numbered outline in a table? Yes, you can. But Word is rather prickly when it comes to using the keyboard ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Opening a Word Document when Starting the Computer

Some people use their computers for little else, other than to work on Word documents. If that is the case with you, then ...

Discover More

Incorrect Page Counts Shown in Status Bar

A common statistic to see on the status bar is what page number you are working on in your document. If the page numbers ...

Discover More

Creating Two Versions of the Same Document

You may often need to create two versions of the same document, one with everything and the other with a subset of what ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four less than 7?

2022-11-22 06:22:41

Jamies

Not sure that it is a good idea
having a copy of the document maintained at the time the original is saved.
The problem being that any mistake in the edited one is immediatelly in the other, so
deleting a lot of text in mistake loses that text in both copies.

So, what that is doing is only effective if the copy is on another drive (not partition, but drive) or maybe storage on cloud, or another PC.

A better approach would be to leave a trail of versions, (with a date/timestamp) as part of the filename. there is a VBA command savecopyas that could be invoked as part of a macro invoked by the user using the Save, or SaveAs process.

Noting the Junctions facility in the commment by David, there is also the hardlink facility for a file
where, in a similar manner to the shortname that is sometimes used by the OS to access files, and folders , there is the ability to create a second name for a file, and that name can be in a separate folder.
So, there will be multiple names pointing to the same actual set of data on disk, and the OS will not delete the file until all of the names have been 'deleted'

There is the OS (win-7) facility for creating a timestamped copy of files - but that is done on a set interval, and requires that the timestamped copy be on a different drive.

And MS proides Onedrive - with a n OS option to save the file to the onedrive as a default - and that is supposed to come with a trail so that crypto-malware does not get to change the versions in the trail.

Also see Dropbox, or email a copy to a backup (gmail?) account

HOWEVER, creating a trail of versions does mean you have to manually manage the space they are taking up

What method is appropriate is really dependant on what you want the 'copy' to actually provide.

Maybe even a selectable macro within the document that will put a copy onto a shared folder (with only you having write authority to it) for others to read, or take their own copies from.

So - first .. do you have continual access to another drive, personal cloud, shared network of PC's, or the internet with the cloud, that will be running,
I used to reccommend Spideroak - an encrypting, compacting facility that ran as a service to manage saving to their (free?) store the changed blocks of files in specified folders, creating sets of base files with incremental changes, so effectively being incrementing versions - and the facility to download the files to the creating PC, or others, as encrypted versions, only decrypted on the PC when the appropriate password was supplied -
The 'service' being either started at OS startup, or at any time specified, or manually - as in when you had changed a file in the specified folder(s), and doing that when the file was closed, and the cloud access was accessible.

So - back to - What facilities do you have - and what do you actually want to achieve with the copies!


2019-01-14 14:10:58

David Gray

Occam's Razor wins again; I've used shortcuts to provide myself with ready access to reference documents in multiple project directories (folders) for many years. If you need access to folders, there are at least two similar options, each good in its own way.

1) Folders are legitimate targets for shortcuts.

2) Windows provides the mklink.exe system utility, which can create junctions, which appear in the folder tree as if they were child folders. For example, the following command creates a junction, F:\Source_Code\Visual_Studio\Projects\WizardWrx_Libs\AnyCSV\docs , which shows up in F:\Source_Code\Visual_Studio\Projects\WizardWrx_Libs\AnyCSV as a subfolder called docs . In this example, the source folder, F:\Source_Code\Visual_Studio\Projects\WizardWrx_Libs\AnyCSV\docfx_project\_site, is nested more deeply within the parent folder, but junctions can point to any directory that is visible to Windows.

mklink /J F:\Source_Code\Visual_Studio\Projects\WizardWrx_Libs\AnyCSV\docs F:\Source_Code\Visual_Studio\Projects\WizardWrx_Libs\AnyCSV\docfx_project\_site

Junctions are present in most Windows installations; they are the reason that you can still refer to "C:\Documents and Settings\" even though no such actual directory exists in modern Windows installations. When Windows sets itself up, it creates "C:\Documents and Settings\" as a junction that points to C:\Users. Since I do my best to avoid using "C:\Documents and Settings\" as much as possible, I didn't give much thought to junctions until it occurred to me that it was the simplest way to solve a problem that was preventing me from efficiently maintaining the documentation for the libraries that I host on GitHub.


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.