Remove mail merge data source from MS Word Document

116,623

Solution 1

In many (if not all) cases, answering "No" to this prompt should be enough to disconnect the data source. But you should then save the document, and try opening it again.

If that doesn't work, try to get to the point where the document is open, then open the Mailings tab, click the Start Mail Merge button in the Start Mail Merge group, then select Normal Word Document from the dropdown. Then save the document.

If you don't save the document after disconnecting the data source, the problem will recur.

Solution 2

This took me eternity so I thought I'd post an answer as well.

In my case I had to remove the old template document, which triggered the query.

This is possible in the developer tools menu, on the very right.

Share:
116,623
CoolUserName
Author by

CoolUserName

Updated on September 18, 2022

Comments

  • CoolUserName
    CoolUserName over 1 year

    I am using Microsoft Word 2013.  I have a document that, when opened, prompts me with:

    Opening this document will run the following SQL command:
    SELECT * FROM C:\somepath\somefile.mrg
    Data from your database will be placed in the document.  Do you want to continue?

    I am trying to find where in the Word document this data source is being specified, and hopefully remove it completely.

  • Admin
    Admin almost 9 years
    @Steph - when the document has no data source, the Insert Merge Field menu will indeed be greyed out. In order to get it back, you have to connect the document to a data source again. There used to be a feature that let you connect to a "header source" to allow the user to use the field dropdown even though no data source was connected, but .docx format does not support header source properly so it is generally simpler to assume that that approach no longer works.
  • martin.lindenlauf
    martin.lindenlauf about 4 years
    Same in my case (Word 365) - Word always wanted to process an SQL query because the document had an deprecated mail merge document as template. Using the "Normal Word Document" in the "Start Mail Merge" group does not solve the problem in that case. Thanks @SandroKGS for giving this hint here!
  • Marcus Mangelsdorf
    Marcus Mangelsdorf about 2 years
    ☝ You may also need to change anything else about your document (e.g. adding and then deleting a character) for the saving to be effective.