word.Applicatio n msword = new word.Applicatio n();
object missing = Type.Missing;
// Hidden Word document
msword.Visible = false;
try
{
word.Document doc = LinqTool.WordCr eateDocument(re f
msword);
LinqTool.WordIn sertText(ref doc, pw.ToString());
object pages = "1";
object copies = "1";
object range = word.WdPrintOut Range.wdPrintCu rrentPage;
object items = word.WdPrintOut Item.wdPrintDoc umentContent;
object pageType = word.WdPrintOut Pages.wdPrintAl lPages;
object oTrue = true;
object oFalse = false;
doc.PrintOut(
ref oTrue, ref oFalse, ref range, ref missing, ref missing, ref missing,
ref items, ref copies, ref pages, ref pageType, ref oFalse, ref oTrue,
ref missing, ref oFalse, ref missing, ref missing, ref missing, ref
missing);
}
catch (Exception ex)
{
MessageBox.Show ("Design Report could not be
saved\r\n\r\n" + ex.Message, "Save Error");
}
finally
{ // Always Close the Word document
object saveChanges = (object)false;
msword.Quit(ref saveChanges, ref missing, ref missing);
}
With this code I try to print pw.string() to a default printer
I can with my code save to a file by use my WordCreateDocum ent and
WordInsertText( ..) but I don't get my Default Printer --
Kim S.
object missing = Type.Missing;
// Hidden Word document
msword.Visible = false;
try
{
word.Document doc = LinqTool.WordCr eateDocument(re f
msword);
LinqTool.WordIn sertText(ref doc, pw.ToString());
object pages = "1";
object copies = "1";
object range = word.WdPrintOut Range.wdPrintCu rrentPage;
object items = word.WdPrintOut Item.wdPrintDoc umentContent;
object pageType = word.WdPrintOut Pages.wdPrintAl lPages;
object oTrue = true;
object oFalse = false;
doc.PrintOut(
ref oTrue, ref oFalse, ref range, ref missing, ref missing, ref missing,
ref items, ref copies, ref pages, ref pageType, ref oFalse, ref oTrue,
ref missing, ref oFalse, ref missing, ref missing, ref missing, ref
missing);
}
catch (Exception ex)
{
MessageBox.Show ("Design Report could not be
saved\r\n\r\n" + ex.Message, "Save Error");
}
finally
{ // Always Close the Word document
object saveChanges = (object)false;
msword.Quit(ref saveChanges, ref missing, ref missing);
}
With this code I try to print pw.string() to a default printer
I can with my code save to a file by use my WordCreateDocum ent and
WordInsertText( ..) but I don't get my Default Printer --
Kim S.