update 20250129
This commit is contained in:
@@ -42,7 +42,13 @@ namespace OfficePrinter
|
||||
wordDocument = appWord.Documents.Open(Filename);
|
||||
Thread.Sleep(OfficeSleep);
|
||||
appWord.Visible = true;
|
||||
|
||||
appWord.Activate();
|
||||
wordDocument.Activate();
|
||||
Microsoft.Office.Interop.Word.Window window = appWord.ActiveWindow;
|
||||
window.SetFocus();
|
||||
window.Activate();
|
||||
appWord.WindowState = WdWindowState.wdWindowStateMinimize;
|
||||
appWord.WindowState = WdWindowState.wdWindowStateMaximize;
|
||||
if (printmacro == "") return "";
|
||||
try
|
||||
{
|
||||
@@ -50,6 +56,7 @@ namespace OfficePrinter
|
||||
}
|
||||
catch (Exception e) {
|
||||
error = e.Message.ToString()+" / "+printmacro;
|
||||
|
||||
}
|
||||
Thread.Sleep(OfficeSleep);
|
||||
wordDocument.Close();
|
||||
|
||||
Reference in New Issue
Block a user