Mirroring Documents

by Allen Wyatt
(last updated December 3, 2015)

6

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:

http://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, the 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 other solutions discussed in this tip.

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, and 2013.

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

Automatic AutoCorrect Exceptions for Beginning Sentences

When automatically capitalizing the beginning of sentences, Word relies on how you historically have done your typing. This ...

Discover More

Creating a Worksheet Copy by Default

Excel makes it relatively easy to copy worksheets to a different workbook. That doesn't mean it couldn't be made simpler ...

Discover More

Tracking Down Invalid References

When you discover that there is an invalid reference in a workbook, you can have a bear of a time tracking down the problem. ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

MORE WORDTIPS (RIBBON)

Saving Personalized Copies of a Document

Need a series of documents that include an individual's name or a company name? Here's a handy little macro that will make ...

Discover More

Extra Document File Being Saved

You may be surprised sometime to save a document and find out that Word actually saves what appear to be two copies of the ...

Discover More

Read-Only Files

Read-only documents (those that cannot be updated) are part and parcel of working with Word. There are many ways that a ...

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 for this tip:

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}] in your comment text. You’ll be prompted to upload your image when you submit the comment. 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 eight more than 7?

2015-12-04 17:36:48

Phil Rabichow

You CAN change the original document when opening the copy & making changes to it.

1. Use the Includetext field to create the copy.
2. The format should be
{ INCLUDETEXT "C:\Documents and Settings\Filepath\This is original doc.doc" * MERGEFORMAT }
-OR-
{ INCLUDETEXT "C:/Documents and Settings/Phil/Desktop/This is original doc.doc" * MERGEFORMAT }

Note: your entire filepath should either be 2 backslashes or 1 forward slash. You can keep or omit the * mergeformat, but always use the backslash just before it, if you keep it.
3. If you make changes to the original, they'll be reflected in the copy (you might have to select the field & press F9).
4. If you make changes in the copy, make sure the insertion point is within the field & press Ctrl+Shift+F7. This will update the original!


2015-12-03 13:19:44

Zvi

Sorry for typo, I suggest using Dropbox and Sharing


2015-12-03 13:18:35

Zvi

I suggest suing Dropbox and Sharing


2013-05-14 04:12:00

Stephen

As usual, the 'why' is key.

In a business environment, the most common reason for this requirement is that you own the document, but need to place it in a shared folder for everyone to see it. Most likely, in these circumstances the shortcut method will not work without setting sharing permissions ...

'One way' mirroring has the advantage that you periodically reset the file to be as in your master copy, if anyone has changed it, but if you want complete control, everyone to see the version you create, you need to set read only access, and perhaps document protection too. Perhaps some kind person would identify the minor addition to the macro for this.

I suspect that Sharepoint or something might be a better solution in these circumstances, but I don't use it, and so will shut up here!


2013-05-13 10:27:55

Mike

Bryan, I disagree. Not only is the shortcut approach not the best solution - it's not even a solution at all.

The need was "to save in two different folders on her system" and the first solution is really the only good answer. The second approach is probably acceptable only because it at least offers one-way mirroring, but if the user literally needs a file in two different locations and needs one to be updated when the other is edited, the macro is the only answer. Setting up a shortcut in the folder where you need the document is likely a waste of time.


2013-05-13 07:24:42

Bryan

As usual, you posted the tips in decreasing order of usefulness. I'm not sure why someone would need a document cloned to two different locations, but the shortcut is the best solution.


Newest Tips
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.

Links and Sharing
Share