T
Thierry Thoua
Hello,
I've a "little" problem with Word interop (Office 11). I'd like to
automate the mailmerge.... I've a word file and a .txt file (a csv).
The text file is in UTF-8 encoding.
This is my "code" :
this.document.MailMerge.MainDocumentType =
WdMailMergeMainDocType.wdFormLetters;
this.document.MailMerge.Destination =
WdMailMergeDestination.wdSendToNewDocument;
object subType = WdMergeSubType.wdMergeSubTypeOther;
object format = WdOpenFormat.wdOpenFormatUnicodeText;
object confirmConversions = false;
this.document.MailMerge.OpenDataSource(cheminFichier, ref
format, ref confirmConversions, ref ComWrapper.OpenDocumentAsReadOnly,
ref
ComWrapper.Missing, ref ComWrapper.Missing, ref ComWrapper.Missing,
ref ComWrapper.Missing,
ref
ComWrapper.Missing, ref ComWrapper.Missing, ref ComWrapper.Missing,
ref ComWrapper.Missing,
ref
ComWrapper.Missing, ref ComWrapper.Missing, ref ComWrapper.Missing,
ref subType);
document.MailMerge.Execute(ref ComWrapper.Missing);
object index = 1;
_Document mailMergeResult = this.word.Documents.get_Item
(ref index);
It works fine ... BUT .. Sometimes when I load a lot my service ...
The word doesn't use the "utf-8" encoding ... Word use "Windows
standard (default)" => When I execute the mail merge ... I've a window
with a wrong key "ïMyKey" and not "MyKey" .... What's wrong ???
Do you have any idea ?
Thanks
I've a "little" problem with Word interop (Office 11). I'd like to
automate the mailmerge.... I've a word file and a .txt file (a csv).
The text file is in UTF-8 encoding.
This is my "code" :
this.document.MailMerge.MainDocumentType =
WdMailMergeMainDocType.wdFormLetters;
this.document.MailMerge.Destination =
WdMailMergeDestination.wdSendToNewDocument;
object subType = WdMergeSubType.wdMergeSubTypeOther;
object format = WdOpenFormat.wdOpenFormatUnicodeText;
object confirmConversions = false;
this.document.MailMerge.OpenDataSource(cheminFichier, ref
format, ref confirmConversions, ref ComWrapper.OpenDocumentAsReadOnly,
ref
ComWrapper.Missing, ref ComWrapper.Missing, ref ComWrapper.Missing,
ref ComWrapper.Missing,
ref
ComWrapper.Missing, ref ComWrapper.Missing, ref ComWrapper.Missing,
ref ComWrapper.Missing,
ref
ComWrapper.Missing, ref ComWrapper.Missing, ref ComWrapper.Missing,
ref subType);
document.MailMerge.Execute(ref ComWrapper.Missing);
object index = 1;
_Document mailMergeResult = this.word.Documents.get_Item
(ref index);
It works fine ... BUT .. Sometimes when I load a lot my service ...
The word doesn't use the "utf-8" encoding ... Word use "Windows
standard (default)" => When I execute the mail merge ... I've a window
with a wrong key "ïMyKey" and not "MyKey" .... What's wrong ???
Do you have any idea ?
Thanks