how to edit Word 2010 document without running macro

I have the macro shown below in a Word 2010 document. I have enabled the macro and marked the document as "trusted". Now, I need to edit the document, but whenever I open the doc, it runs the macro. You will notice that the line 15 of the macro is 'docMain.Close wdDoNotSaveChanges', so it closes the main document and is therefore no longer avaiable in Word. I've googled all over and can't seem to find a way to open the document in edit mode without running the maco. Need help!

Option Explicit

Private Sub Document_Open()
DoMailMerge
End Sub

Public Sub DoMailMerge()
    Dim docMain As Document
    Set docMain = ThisDocument
    
    With ActiveDocument.MailMerge
        .Destination = wdSendToNewDocument
        .Execute
    End With
    docMain.Close wdDoNotSaveChanges
End Sub

Open in new window

LVL 1
jmarkfoleyAsked:
Who is Participating?
 
tdlewisCommented:
You can move the document to a non-trusted location, edit the macro, and then move it back to the trusted location.
0
 
albeloCommented:
To prevent Word from loading the macros type winword /m and hit Enter
0
 
jmarkfoleyAuthor Commented:
tdlewis: Your suggestion seems rather brute-force, but it worked and is easy. I moved the document to another folder; opened it; got the yellow "enable macros" banner; did not enable the macro; and was able to edit my document. When I moved it back I got the warning again and did enable macros. It then worked fine.

albelo: I assume you meant to enter that command in Start > search, then File > Open ...
I tried that and it worked too, but tdlewis' move to different folder method is simpler for a clerical user to perform, so I chose that solution.

I give cudos to microsoft for inventing the "trusted document" idea which is a great improvement over the Word 2003 method of either reducing security or obtaining a certificate, but I take away cudos for not providing a straightforward way to NOT execute macros (like, for example, right-click on the document and have an option to "Open without executing macros").
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.