Jump to content
Sign in to follow this  
Andy007

MS Word - OpenDataSource issues

Recommended Posts

Andy007

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)

Share this post


Link to post
Share on other sites
StSchnell

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

Share this post


Link to post
Share on other sites
Andy007

Thanks Stefan,

Did not work for me... I tried about 10 variations but no good.

Any other ideas?


Regards,Andy (no, the other one)

Share this post


Link to post
Share on other sites
Andy007

Does anyone else have this problem, or am I alone... All alone. . . :P


Regards,Andy (no, the other one)

Share this post


Link to post
Share on other sites
Andy007

I think I have it working now.

I had to re-install MS Office.


Regards,Andy (no, the other one)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×