Hi Sonny,
No problem. Remember, it's C#
string wordScript;
// load word
wordScript = "<script language=\"vbscript\">\n";
wordScript += "set app = createobject(\"Word.Application\")\n";
wordScript += "set oMainDoc = app.Documents.New()\n";
wordScript += "set oSel = app.Selection\n";
wordScript += "app.Application.Visible = True\n";
// enter some text
wordScript += "oSel.TypeText \"This is some text\"\n";
wordScript += "oSel.TypeParagraph\n"; // newline
wordScript += "</script>\n";
Then you need to add any code you want to use to load the Word Mailing
Labels dialog / print / save / whatever, then call the following to make the
VBScript run...
if(!IsStartupScriptRegistered("mergeScript"))
RegisterStartupScript("mergeScript", wordScript);
Having said all that, this *might* work, although I havent tested it... Id
try it before the word thing..
string wordScript;
wordScript = "<script language=\"vbscript\">\n";
wordScript += "set objShell = CreateObject("WScript.Shell")\n";
wordScript += "set objScriptExec = objShell.Exec("c:\your.bat")\n";
wordScript += "</script>\n";
if(!IsStartupScriptRegistered("mergeScript"))
RegisterStartupScript("mergeScript", wordScript);
As I said, might work............ dunno!
HTH
Dan