![word document not printing text word document not printing text](https://i.ytimg.com/vi/w2R_aTssX3g/maxresdefault.jpg)
If while in the Print Preview and Edit mode you select the Print Preview and Print control the backstage view and preview appears with the PHT suppressed.ĥ. In Print Preview and Edit mode, the PHT is suppressed.Ĥ. If you really want to see what the document will look like with PHT suppressed then add the PrintPreviewAndEdit control to your QAT. Due to a plethora of complications associated the inability to intercept the PrintPreviewAndPrint command, the PHT will still appear visible in the backstage preview pane when you select the File tab in Word 2010/2013, but that visible PHT IS NOT printed.ģ. Has time to spool the content to the printer queue.Ģ. This delay is needed because changing the Hidden attribute immediately (at the end of the DocumentBeforePrint routine) would happen before the PrintPreviewAndPrint command If you often print large forms, you may want to increase the delay. The delay should provide ample time to let the print command finish spooling the document to the printer queueġ.
![word document not printing text word document not printing text](https://i.stack.imgur.com/k96Sc.jpg)
When a Word 2010 user clicks File>Print>Print that action triggers the clsPrint oWordApp_DocumentBeforePrint procedure.The Class_Initialize procedure in the class initializes the oWordApp variable to the Word application object. It sets the initial variables and if the application is Word 2010/2013 it initializes the variable session_clsPrint to an instance of the class module clsPrint. The AutoExec macro runs automatically each time you start Word.The following is an explanation of how the process more or less works: Note: You have to close and restart Word in order fo the AutoExec macro to initialize the clsPrint class. Try it out on documents with and without uncompleted content controls.'Intercepts the Word 2007 Print Preview command 'User likely was in PPEM then used PPPM but didn't print. 'Intercepts the Word 2010 Print Preview/2013 Edit Mode 'Intercepts the Word 2007/2010/2013 Quick Print commands 'Prevent triggering a duplicate print in the class modules (Word 2010/2013)ĪctiveDocument.PrintOut Background:=False 'Intercepts the Word 2007 Menu>Print>Print commandĪctiveDocument.Styles("Placeholder Text").Font.Hidden = True 'Delayed call from class Word 2010/2013 onlyĪctiveDocument.Styles("Placeholder Text").Font.Hidden = False 'Initialize variable and class (Word 2010/2013 only) when Word starts Public p_bInPreviewPrintEditMode As Boolean
#Word document not printing text code
Paste the following code in the class module.Some elements (e.g., the class module) is not required for Word 2007. The method is developed for Word 2010, but includes all necessary code for Word 20 users. The Normal project is project associated with the Normal template. Rename the class module "clsPrint." Rename the standard module any meaningful name. Using the VBE Insert menu, insert a class module and a standard module in the Normal project.Open Word, open the VB Editor (VBE) (i.e., press ALT+F11) and open the Normal project.This can of course be done manually if you have a willing group of form users, but an automated process requires a VBA solution. PrintHiddenText property to false and print the document the PHT text will not be printed. Hidden to true, set the application options.
![word document not printing text word document not printing text](https://s3-us-west-2.amazonaws.com/courses-images/wp-content/uploads/sites/1844/2017/04/25180106/blankdocument1.png)
If you temporarily set the Placeholder text style font property. Placeholder text, like most text in Word, is defined by a style. The first method employs the application event "DocumentBeforePrint," repurposed Print commands and a temporary modification of the document's Placeholder text style. Method I - Detect Events/Intercept Commands/Modify PHT Style There is no option in Word to exclude printing content control PHT, and without an intensive form validation process, you can't make the user fill out each field.Įach of the automated solutions provided require VBA which means the template and form documents must be macro enabled (i.e. Unfortunately there isn't a simple solution. Representation of a printed document with bubble added for emphasis