MS Office Word 2007/2010 - how to view editing an existing SELECT inline merge?

I have several documents with merge text in them, I have to change the data source, but for this I need to extract all SELECT queries from these documents in order to find tables and fields. (I do not have access to the old data source as it no longer exists).

I searched all day and can't figure out how to retrieve or show the SELECT query applied to each document. When I run one document, a dialog box opens saying that Word will launch the next SELECT X, Y query .... but since the queries are quite large, I don’t see their whole structure, I can not resize the box dialog box either ...

Is there any way to extract these options?

+3
source share
2 answers

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

+2

Alt + F11 Word, VBA.

, , .

, , ?

0

Source: https://habr.com/ru/post/1790706/


All Articles