- #MICROSOFT WORD CONTENT CONTROL HOW TO#
- #MICROSOFT WORD CONTENT CONTROL CODE#
- #MICROSOFT WORD CONTENT CONTROL SERIES#
- #MICROSOFT WORD CONTENT CONTROL ZIP#
#MICROSOFT WORD CONTENT CONTROL CODE#
Now copy and paste the code from the Word VBA Editor into the Excel VBA Editor. Then click OK.Īs we are using Early Binding we need to declare the Application as a variable as follows: Dim WordApp As Word.Application In the Visual Basic Editor click Tools -> References select Microsoft Word x.xx Object Library. Let’s head back to the Excel VBA Editor and use the Early Binding method to control to Microsoft Word. Sub Macro1()ĭocuments.Add Template:="Normal", NewTemplate:= False, DocumentType:=0Įnd Sub Add the code to Excel VBA and amend It may be slightly different, but not significantly. Your code should look like the following. In this example: Normal -> Modules -> NewMacros. Click: Developer -> Visual Basic.įind the location of your recorded code in the Visual Basic Editor.
![microsoft word content control microsoft word content control](https://d33v4339jhl8k0.cloudfront.net/docs/assets/5b85b73b2c7d3a03f89e3733/images/5d02bc972c7d3a1cad5b5b72/file-wDYWaYLH2K.png)
We can now view the code for opening a new Word Document in the Visual Basic Editor. Stop the Macro from recording – Developer -> Stop Recording Open a new Word Document – File -> New -> Blank Document Click OK – the Macro Recorder is now running. Make a note of the “Store macro in” option, as we will need to know where to find the recorded code later. Firstly, lets create the macro to open a new word document.Ĭlick – Developer -> Record Macro. Using the Word Macro Recorder is again, similar to the Excel Macro recorder.įor the example in this post, we will create a macro which will open a new Word document, then copy a chart from Excel and paste it into that Word document. The key to the success of this method is taking small sections of code and building up a complex macro bit by bit. Then tick the Developer Ribbon option, OK. In Word: File -> Options -> Customize Ribbon If you have enabled the Excel Developer menu it is the same process in Word. The process I am about to show you may not create the most efficient code, but I know this process works, because I have used it myself to automate lots tasks using Microsoft Word. I am not an Excel VBA expert (I’m more of an Excel VBA tinkerer), and I am certainly not a Word VBA expert.
#MICROSOFT WORD CONTENT CONTROL HOW TO#
In the first part we looked at the basics of how to reference other applications using Early Binding or Late Binding.
#MICROSOFT WORD CONTENT CONTROL SERIES#
All Rights Reserved.This post is the second in a series about controlling other applications from Excel using VBA.
![microsoft word content control microsoft word content control](https://media.gcflearnfree.org/ctassets/topics/255/form_text_plain.png)
Spaces are not allowed however you can use the underscore character "_" to separate words. Each form field should have a unique bookmark name.īookmarks can contain numbers but must begin with a letter.
![microsoft word content control microsoft word content control](https://help.sap.com/doc/c58cc35c72d44782b5f5a9d84ddc554b/2020.latest/en-US/loio6ae93e54311aea6fe10000000a423f68_LowRes.png)
![microsoft word content control microsoft word content control](https://thegeekpage.com/wp-content/uploads/2015/11/combo-box-content-control-fillable-forms-offcie-2016.png)
It is always a good idea to provide a sensible and logical bookmark name for each of your form fields. When limiting the field length make sure you include space for any special characters such as dashes or hyphens. These two types of data let you automatically display the date and time the form was completed. To add a text form field place the insertion point where you want the field to be placed and select Text Form Field - Inserts a Text Form field allowing users to insert text, numbers symbols and spaces. This can be inserted from the Forms toolbarĪ text field records information that only the user can enter.įor example this might be customer address, telephone number etc. Text form fields can have unlimited length Text form fields can also be used to perform calculations.
#MICROSOFT WORD CONTENT CONTROL ZIP#
You can use a text form field to collect basic text information such as a name or addressĪlternatively you can also use text form fields to request other types of data such as numbers, dates, times, phone numbers, zip codes, percentages etc. A text form field can be set up to require a variety of different types of input from the user.