Jump to content

MS Word - OpenDataSource issues


Andy007
 Share

Recommended Posts

Hi All,

I am finding my word merge program is caching my datasource and my autoit program is not overriding this cached value.

Here is a few lines from my autoit program to reset the datasource:

$mm = $wd.Activedocument.MailMerge

$mm.OpenDataSource ('"' & $data & '"', 0, true, true, true, false, "", "", false)

Where $wd is my word object and $data is my new csv data file.

Any help would be greatly appreciated.

Word2003/2007+WinXP/Vista

Regards,Andy (no, the other one)

Link to comment
Share on other sites

  • 2 weeks later...

Hello Andy,

is it possible that Word hold the connect to the source and your program want to change it?

Try the command

Word.Application.Activedocument.MailMerge.MainDocumentType = wdNotAMergeDocument

to close an open connection.

Hope it helps.

Cheers

Stefan

P.S. wdNotAMergeDocument = -1

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...