How to create a copy of an open document

Article contributed by Ibby

If your current document has been saved at least once, the following will:

All this occurs without saving the current document.

Dim myCopy As Document
Dim docName As String

' Retrieve name of ActiveDocument
docName = ActiveDocument.Name

' Test if Activedocument has previously been saved
If ActiveDocument.Path = "" Then

    ' If not previously saved
   
MsgBox "The current document must be saves at least once."

Else

    ' If previously saved, create a copy
    Set myCopy = Documents.Add(ActiveDocument.FullName)

    ' Show SaveAs dialog to allow user to save copy
   
With Dialogs(wdDialogFileSaveAs)
        ' Set name in SaveAs dialog
       
.Name = "Copy_of_" & docName
        .Show
    End With

    ' Close copy
   
myCopy.Close

End If

See also:
How to copy an open file using VBA
Useful WordBasic commands that have no VBA equivalent