If you open the .docx file with the unzip utility , such as 7-Zip, this will open the folder / file structure inside.
The root folders should be something like docProps, Word, _Rel. Locate the Word folder and open the settings.xml file. inside this you should see a query (along with mappings of database columns to fields in the document).
I tried this in a Word 2007 mapping for a client table, and the saved query was:
query w:val="SELECT * FROM "Customer" "
Edit: extract from settings.xml (I had to cut <and> to show this)
: XMLNS: = "http://schemas.openxmlformats.org/officeDocument/2006/math" XMLNS: = ": -Microsoft-: :" XMLNS: = "http://schemas.openxmlformats.org/officeDocument/2006/relationships" XMLNS: = "http://schemas.openxmlformats.org/schemaLibrary/2006/main" Xmlns: V = ": -Microsoft-: VML" XMLNS: = "http://schemas.openxmlformats.org/wordprocessingml/2006/main" XMLNS: w10 = ": -Microsoft-: : "
w: zoom w: percent = "100" /
: MailMerge
w: mainDocumentType w: val = "formLetters" /
: linkToQuery/
w: dataType w: val = "native" /
w: connectString w: val = "Provider = SQLOLEDB.1; Integrated Security = SSPI; Persist Security Info = True; = Chinook; = NEWDELL\SQLEXPRESS; Prepare = 1; Auto Translate = True; = 4096; = NEWDELL; = False; , = False" /
w: w: val = "SELECT * FROM" Customer "/
w: dataSource r: id =" rId1"/
: viewMergedData/
w: odso.... ..