word.Application msword = new word.Application();
object missing = Type.Missing;
// Hidden Word document
msword.Visible = false;
try
{
word.Document doc = LinqTool.WordCreateDocument(ref
msword);
LinqTool.WordInsertText(ref doc, pw.ToString());
object pages = "1";
object copies = "1";
object range = word.WdPrintOutRange.wdPrintCurrentPage;
object items = word.WdPrintOutItem.wdPrintDocumentContent;
object pageType = word.WdPrintOutPages.wdPrintAllPages;
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 WordCreateDocument and
WordInsertText(..) but I don't get my Default Printer --
Kim S.