![]() |
|
#1
|
||||
|
||||
![]()
Although the code could be improved, there is nothing obvious about it that would cause the errors you're experiencing. Given that the error message relates to fonts, perhaps you have a corrupt one in use by the document(s) throwing the error. Fixing that would entail identifying the font(s) used in that document that are not used elsewhere and reinstalling them.
As an example of the possible improvements, you could make the code more efficient by replacing: Code:
Dim oSct As Section Dim iSection As Integer ' iSection = 1 ' For Each oSct In ActiveDocument.Sections With ActiveDocument.Sections(iSection).PageSetup .FirstPageTray = wdPrinterUpperBin .OtherPagesTray = wdPrinterMiddleBin End With iSection = iSection + 1 ' Next oSct Code:
Dim oSct As Section ' For Each oSct In ActiveDocument.Sections With oSct.PageSetup .FirstPageTray = wdPrinterUpperBin .OtherPagesTray = wdPrinterMiddleBin End With Next oSct Code:
Dim iSection As Long With ActiveDocument For iSection = 1 To .Sections.Count With .Sections(iSection).PageSetup .FirstPageTray = wdPrinterUpperBin .OtherPagesTray = wdPrinterMiddleBin End With If iSection Mod 20 = 0 Then DoEvents Next iSection End With PS: When posting code, please use the code tags, indicated by the # button on the posting menu. Without them, your ~400 lines of code lost much of whatever structure it had.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Tags |
ms word, print macro, win10 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Embeding Excel Docs in Word - Receiving Memory Error Message if Excel is open | kdash | Word | 0 | 05-06-2015 09:38 AM |
![]() |
detobias | Excel | 1 | 06-03-2014 09:25 AM |
Error in printing | callkalpa | Word | 0 | 09-21-2010 07:35 PM |
TOC printing Error Bookmark not Defined | techexpressinc | Word | 0 | 12-14-2008 05:24 PM |
Error message when printing e-mails | nolson | Outlook | 0 | 01-02-2006 09:50 AM |