MailMerge.OpenDataSource() produces strange error message on Hangulconversion

U

Uri Dor

Hello,
I'm developing a C# (.NET 1.1) app that does some mail merging using
Office 2003. On my development machine all works well, but when I take
it to another developer's machine, I get the following messagebox:

---------------------------
ARA Hangul 97 Converter
---------------------------
There is no Johap(0x551) code page.
---------------------------
OK
---------------------------

(note: my code has nothing to do with Hangul. Hebrew - yes, but Hangul - no)

and then the code gets an exception on HRESULT = 0x800A140C

the offending method is:

private void openDataSource(Word.Application objWord,string csvFname)
{
string fsrc_path = Path.GetDirectoryName(csvFname);
string fsrc_name = Path.GetFileName(csvFname);
string open_sql_stmt = "SELECT * FROM " + fsrc_name;

//prepare data source
object ods_Format = Word.WdOpenFormat.wdOpenFormatAuto;
object ods_ConfirmConversions = false;
object ods_ReadOnly = false;
object ods_AddToRecentFiles = false;
object ods_Revert = false;
object ods_SQLStatement = open_sql_stmt ;

objWord.ActiveDocument.MailMerge.OpenDataSource(
csvFname , ref ods_Format , ref ods_ConfirmConversions ,
ref ods_ReadOnly ,
ref null_object, //LinkToSource ,
ref ods_AddToRecentFiles ,
ref null_object, //PasswordDocument ,
ref null_object, //PasswordTemplate ,
ref ods_Revert ,
ref null_object, //WritePasswordDocument ,
ref null_object, //WritePasswordTemplate ,
ref null_object,
ref ods_SQLStatement , ref null_object);
}


any ideas?
 
U

Uri Dor

found the problem - the CSV file I produced was in Encoding.UTF8 and
when I changed that to Encoding.BigEndianUnicode it worked fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top