Picture Content Control For Ms Word For Mac 2016

Content controls can provide instructional text for users, and you can set controls to disappear when users type in their own text. For detailed information about content controls, including descriptions an instructions for each type of control, see Create forms that users complete or print in Word. If you find that you cannot make changes to a picture, and you have the desktop version of Word, select Open in Word to open your document in Word and make changes to its layout. When you are done, press Ctrl+S to save your document to its original location. You can then open the document again in Word for the web, and continue editing.

The Anchorage

Personal website of Gregory K. Maxey, Commander USN (Retired)

Do you have ad-blocking software enabled? While I respect your right to do so, your donations and the minimal advertisements on this site help to defray internet and other costs of providing this content. Please consider excluding this website from blocking or turning off the blocker while browsing this site.

DISCLAIMER/TERMS OF USE

The information, illustrations and code contained in my 'Microsoft Word Tips' are provided free and without risk or obligation.

However, the work is mine. If you use it for commercial purposes or benefit from my efforts through income earned or time saved then a donation, however small, will help to ensure the continued availability of this resource.

If you would like to donate, please use the appropriate donate button to access PayPal. Thank you!


This Microsoft Word Tips & Microsoft Word Help page provides a couple of solutions to the frequently asked question, 'How do I prevent the placeholder text (PHT) in uncompleted content controls from printing?' The solutions provided are a result of collaborative effort with MVP Jay Freedman.

The problem can occur often. You prepare a form and send it out for completion. Users complete part of the form and leave some of the content controls uncompleted. When the form is returned and printed the PHT in the uncompleted content controls are printed. This results in an unsightly finished form.


Representation of a printed document with bubble added for emphasis

Unfortunately there isn't a simple solution. 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.

Each of the automated solutions provided require VBA which means the template and form documents must be macro enabled (i.e., .dotm and .docm extensions).

Method I - Detect Events/Intercept Commands/Modify PHT Style

The first method employs the application event 'DocumentBeforePrint,' repurposed Print commands and a temporary modification of the document's Placeholder text style.

Placeholder text, like most text in Word, is defined by a style. If you temporarily set the Placeholder text style font property .Hidden to true, set the application options .PrintHiddenText property to false and print the document the PHT text will not be printed. This can of course be done manually if you have a willing group of form users, but an automated process requires a VBA solution.

  • Open Word, open the VB Editor (VBE) (i.e., press ALT+F11) and open the Normal project.
  • Using the VBE Insert menu, insert a class module and a standard module in the Normal project. Rename the class module 'clsPrint.' Rename the standard module any meaningful name. I used modPrint.

Notes:
1. The Normal project is project associated with the Normal template. It is global and always loaded.
2. The method is developed for Word 2010, but includes all necessary code for Word 2013 and 2007 users. Some elements (e.g., the class module) is not required for Word 2007.

  • Paste the following code in the class module.
  • Paste the following code in the standard module:
  • Save the template project. Close the VBE. Close and restart Word.
  • Try it out on documents with and without uncompleted content controls.

Note: You have to close and restart Word in order fo the AutoExec macro to initialize the clsPrint class.

The following is an explanation of how the process more or less works:

  • The AutoExec macro runs automatically each time you start Word. 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 Class_Initialize procedure in the class initializes the oWordApp variable to the Word application object.
  • When a Word 2010 user clicks File>Print>Print that action triggers the clsPrint oWordApp_DocumentBeforePrint procedure. This procedure:
  • Stores the current option value
  • Ensures the 'print hidden text' option is off
  • Set the the placeholder text style font 'Hidden' property = True
  • Calls the built-in Word 'PrintPreviewAndPrint' command. This is the command executed by the backstage view Print button. Unlike most other user interface commands, this one can't be intercepted using the usual VBA method of naming a procedure the same as the command -- Thanks, Microsoft!
  • After a defined 5 second delay the procedure calls the RestorePlaceholders procedure located in the standard module. The delay should provide ample time to let the print command finish spooling the document to the printer queue
  • Restores options to the stored setting

Notes:
1. If you often print large forms, you may want to increase the delay. This delay is needed because changing the Hidden attribute immediately (at the end of the DocumentBeforePrint routine) would happen before the PrintPreviewAndPrint command has time to spool the content to the printer queue.
2. 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.
3. If you really want to see what the document will look like with PHT suppressed then add the PrintPreviewAndEdit control to your QAT. In Print Preview and Edit mode, the PHT is suppressed.
4. 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.
5. If you print (i.e, select the 'Print' command) the PHT is suppressed in the printed document and then restored after the short delay.
6. However, if you don't print and return to the document by clicking one of the other tabs on the ribbon then the PHT will not be restored and remain formatted as hidden text.
7. In this situation, you can restore PHT by immediately switching to Print Preview and Edit mode then closing the mode.

  • When a Word 2007 user clicks the Word Menu>Print>Print command the procedure named 'FilePrint' intercepts the built-in 'FilePrint' command. The procedure performs functions similar to the event procedure described above. A delay, however, is not required.
  • The FilePrintDefault procedure intercepts the QuickPrint command in both Word 2007 and 2010/2013. It functions similar to the FilePrint procedure
  • The remaining procedures intercept the named built-in commands to display the Print Preview screens.
  • The class and module procedures have no effect on documents that don't contain content controls, or documents in which all content controls are completed by the user.

Method II - Detect Events/Intercept Commands/Modify PHT Object

The second method, similar to the first, employs the application event 'DocumentBeforePrint,' repurposed Print commands and a temporary alteration of the PHT object itself.

Placeholder text, is a bit peculiar. While it appears to be text, a content control's .PlaceholderText property is actually a Building Block object with a value. For a more in depth discussion see: 5 Curiosities about Placeholders in Word Content Controls (for developers). If we temporarily set the .PlaceholderText property to a zero width space (i.e., ChrW(8203), before printing and restore then original PHT after printing the results will be similar to method I. The code is a bit more complicated and the only advantage is we don't tinker with user options or restrict printing of hidden text in general.

The jury is still deliberating if there is any real advantage over either method, but I use method II in my Content Control Tools Add-In. So here it is:

  • Open Word, open the VBE and open the Normal project.
  • Using the VBE Insert menu, insert a class module and a standard module in the Normal project. Rename the class module 'clsPrint.' Rename the standard module any meaningful name. I used modPrint.

Note: If you have already created the modules using method I then simply delete the existing content in the modules. Do not attempt to use both methods simultaneously.

  • Paste the following code in the class module.
  • Paste the following code in the standard module:
  • Save the template project. Close the VBE. Close and restart Word.
  • Try it out on documents with and without uncompleted content controls.

The process and procedures are similar to Method I, instead of changing the PHT style, it:

  • Loops through the document storyranges to count the CCs and store the CC placeholder objects.
  • Sets each CC PHT object value to a single zero width space.
  • Prints/Print Previews the document.
  • Loops through the document storyranges to restore original PHT.

Method III - Document Content Control Events/Custom Placeholder Text

Method III employs an individual document template, the Document_ContentControlOnEnter & Document_ContentControlOnExit events and custom PHT applied dynamically as the user completes the form.

  • The template should be setup as illustrated in the example below:

Design Mode view
  • Open the VBE, open the templateProject, expand the Microsoft Word Objects folder.
  • Double click the ThisDocument class module. In right side code window, select the Document object.
Picture content control for ms word for mac 2016 free
  • Select all existing code and paste in the following code:
  • Save and close the template and create a new document based on the template.

Unlike the previous methods, this method has no relationship with the application print processes. It simply uses the built-in document events to dynamically apply or remove a visible placeholder text as the user navigates the form.

  • When the form is initially created (new document) or opened, the CC titled 'Name' is selected for user input.
  • If the exits the CC without providing an input, the placeholder text is set to a single space.
  • When the user enters a CC, if that CC is showing placeholder text (even a non-visible single space), a custom visible placeholder text prompt is presented.

Note: This method is the least robust since it is possible that a user enters a CC displaying the visible placeholder text and then prints the document without first exiting the CC. You, or your users, must be sure to physically 'exit' any uncompleted document CC.

Conclusion

If properly applied each of the three methods will result in a more appealing printed form.

That's it! I hope you have found this tips page useful and informative.

PAYMENTS/DONATIONS

Do you want to make a payment for consulting work or donate to help support this site?

PayPal is a safe, easy way to pay online.

Use the appropriate currency 'Donate' button to make a payment or donation.

Picture Content Control For Ms Word For Mac 2016 Download


Search my site or the web using Google Search Engine

Picture Content Control For Ms Word For Mac 2016 Update