Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Hi!
I have a doc. This doc execute a sql sentence: "select * from c:\new_data.doc". the "new_data.doc contents one table with five columns and one row with new data, this data are inserted in the first document with mailmerge?. I wish edit the sql sentence, but .... where are located? The VBA Editor are empty of code Thanks!!! |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
The SQL is usually constructed by Word from the criteria specified by
the user. It is stored in Activedocument.Mailmerge.DataSource.QueryString This is a read-write property so you can assign a new value to it in the usual way, e.g. use the Immediate Window to do Activedocument.Mailmerge.DataSource.QueryString = "SELECT * FROM C:\NEW_DATA2.DOC" If you do that, then save the document, the document should "remember" the data source the next time you open it. However, assignment to QueryString may not always work. For example, in some cases (it depends on the type of data source) you may need to change information in the Connection string, and you can only do that using the OpenDataSource method. Peter Jamieson http://tips.pjmsn.me.uk On 01/12/2009 10:01, SAM wrote: Hi! I have a doc. This doc execute a sql sentence: "select * from c:\new_data.doc". the "new_data.doc contents one table with five columns and one row with new data, this data are inserted in the first document with mailmerge?. I wish edit the sql sentence, but .... where are located? The VBA Editor are empty of code Thanks!!! |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Referencing a User Form using an If statement field code | Mailmerge | |||
Inserting merge code into an If...Then statement | Mailmerge | |||
MS Word 2003 Case statement code | Microsoft Word Help | |||
which statement right , question isChoose the correct statement? | Microsoft Word Help | |||
Including a Merge Code Within an IF Statement | Mailmerge |