

But you might be unclear on which of these tools to utilize if you simply want to apply a colorful border to some of the text in your document. It’s possible that you have already explored the different tabs in the navigational ribbon at the top of the Word window and discovered various things like the WordArt tools that the application offers for customizing the appearance of the text on the page. One of these is the Outline feature, which applies a colored outline effect to the selected text in the document. Some of the more basic ones, like Bold, Italics, and font style changes are things that most Word users become familiar with early on, but there are other formatting options that you might not have cause to use.
#Create text box in word 2013 code#
Let us get acquainted with the VBA code using an example. Input box is a simple dialog that allows us to prompt the user for some information. MsgBox "Why not? They are great!", vbCritical, "VBA" MsgBox "Yes, they are great!", vbExclamation, "VBA"


'Message box to ask question to user with yes or no questionīuttonclick = MsgBox("Do you like VBA?", vbQuestion + vbYesNo, "VBA") MsgBox "Hi, Visual Basic is easy to work with", vbExclamation, "VBA" 'Message box to display information to user Context is numeric expression which is used to identify the help topic by the unique number. Helpfile will identify the Help file available in local disk which can be provided as a help in a dialog box If not given, Microsoft word will be the default title. It is the title for the information given to the user. There are various buttons available for MsgBox() and they can be found on the pictures below. Buttons are those kind of buttons that are given to the users information. It should be inserted inside the double quotation mark. It is the information that can be given to the user. MsgBox(prompt,buttons,title,helpfile,context) Provide a name to your document if prompted. Copy the code we provide below into the Module you just created into your module.Now, hit the Visual Basic button from the Developer tab.First off, go ahead and enable the Developer tab.
#Create text box in word 2013 how to#
How to add VBA code into Word?īefore we go ahead and explain how to add message and input boxes, here’s a quick refresher on how to add your custom VBA code to a Word document. This post has all the information and code samples you’ll need to create fully functional documents with Visual Basic for Applications (VBA) message and input boxes for Microsoft Word. Input boxes are instrumental to capture information from the user. Īs the name suggests a message box is a piece of information that is displayed to the document users. Sometimes, we would like to make our Word documents more interactive and even capture some user input.
