c# - Word document Page Setup takes forever -
the following 2 code lines cause program somehow not continue rest of methods code:
microsoft.office.interop.word.application wordapp = new microsoft.office.interop.word.application(); wordapp.displayalerts = microsoft.office.interop.word.wdalertlevel.wdalertsnone; document = wordapp.documents.add(); document.pagesetup.topmargin = 5; document.pagesetup.orientation = wdorientation.wdorientlandscape;
the application not freeze. every single breakpoint after these lines never reached.
if take these lines out, rest of code runs through , works fine.
resolved: problems cause network printer. because word needs connection printer set page setup , couldn't establish connection printer, waited. setting default printer 1 solved issue.
Comments
Post a Comment