Quantcast
Channel: Word for Developers forum
Viewing all articles
Browse latest Browse all 4350

Problem with ActiveDocument.MailMerge.OpenDataSource(), read only words documents & Office 2013 [C++]

$
0
0

Hi, 

I have a problem with a C++ developpement & Office 2013.

The C++ program open a .doc source document (named for example "_TEST.doc", with fields name & value semicolon separated) and a model document (named "TEST.doc") and merge it in a new document.

I encountered an issue (with office 2013) when "TEST.doc" was in read only mode (but not when in normal mode) : the program begin to open the model ("TEST.doc") then the source doc ("_TEST.doc") but failed at this task (wich is quite strange, nothing should change beetween these 2 type of execution since "_TEST.doc" seem to be the same, it's only "TEST.doc" read only attribute wich change).

After some debugging I came to be aware that if I began to open "_TEST.doc" then "TEST.doc" in my C++ program, the program fail in all case ("TEST.doc" read/write or read only).

All in all it's this portion of code wich fail (trying to open a word "_TEST.doc") : 

String ^ strPathSourceModele = "somepath";

Application ^wrdApp = gcnew Application();

wrdApp->ActiveDocument->MailMerge->OpenDataSource(strPathSourceModele, oMissing,
oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing);

Any light on the issue ? Compatibility problem ? The bug seem to happen only with office 2013, and versions of Visual C++ don't seem to change anything.

Thx


Viewing all articles
Browse latest Browse all 4350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>