Hi,
I want to open an existing Word-Mailmerge-Document and change data source.
loWord = CREATEOBJECT( "Word.Application" )
loWord.Visible = .T.
loDoc = loWord.Documents.Open( lcWord, 0, 1 ) && ReadOnly
loDoc.MailMerge.OpenDataSource( lcFileName, 0,0,0,0,0,"","",0,"","","","SELECT * FROM [" + JUSTSTEM( lcFileName ) + "$]" )
This code workes fine if there are no more Word intances opened. If not and the user close this document, Word will write back to Normal.DOT
How can solve this?
Thomas
I want to open an existing Word-Mailmerge-Document and change data source.
loWord = CREATEOBJECT( "Word.Application" )
loWord.Visible = .T.
loDoc = loWord.Documents.Open( lcWord, 0, 1 ) && ReadOnly
loDoc.MailMerge.OpenDataSource( lcFileName, 0,0,0,0,0,"","",0,"","","","SELECT * FROM [" + JUSTSTEM( lcFileName ) + "$]" )
This code workes fine if there are no more Word intances opened. If not and the user close this document, Word will write back to Normal.DOT
How can solve this?
Thomas