Hi , I am trying to use MailMerge programatically ( from C# ). I am using an Access database file as a data source. The Access database has a password. The following code does not work for some reason even though it should. I get an invalid password textbox.
WordApp = new ApplicationClass();
WordApp.Visible = true;
adoc = WordApp.Documents.Open(ref Template,
ref Missing, ref Missing, ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing, ref Missing, ref Missing);
Object sql = "SELECT * FROM TestMergeTest";
Object conn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + @"C:\Documents and Settings\sebastianharko.AKA-OS\Desktop\See.mdb" + ";"
+ "Jet OLDEDB:Database Password=" + @"notpassword" + ";";
Object password = "notpassword";
adoc.MailMerge.OpenDataSource(@"C:\Documents and Settings\sebastianharko.AKA-OS\Desktop\See.mdb", ref Missing,
ref Missing, ref Missing, ref Missing, ref Missing,
ref Missing, ref Missing, ref Missing, ref Missing,ref Missing, ref conn, ref sql, ref Missing, ref Missing, ref Missing);
Any help would be greatly appreciated.