nomadpa.blogg.se

How to insert placeholder text in word 365
How to insert placeholder text in word 365






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

    how to insert placeholder text in word 365

    HOW TO INSERT PLACEHOLDER TEXT IN WORD 365 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.

    how to insert placeholder text in word 365

    PrintHiddenText property to false and print the document the PHT text will not be printed. Hidden to true, set the application options.

    how to insert placeholder text in word 365

    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






    How to insert placeholder text in word 365