In the Text group, select Text Box, then choose a text box template. Image by Matt Scott Posted on AugAugAuthor C.K. Start by opening the document you want to add a text box to.
Macro to add border to text box in word how to#
Your macro will be saved and you can now use it with any Word document.įor further instructions on how to use macros, see Macros for Editors, in which Paul Beverley offers detailed instructions for understanding and running macros in various versions of Word. Procedure to call in the CommandButton: Sub AddDynamicTextBox () Add Dynamic TextBox and assign it to object Lbl Set lbl ('Forms.TextBox.1') Assign TextBox Name lbl.Caption 'Dynamic TextBox' TextBox Border Style lbl.BorderStyle 2 TextBox Position lbl.Left 10 lbl.
Macro to add border to text box in word windows#
Solutions here are from Windows and web development to travel. Luckily, with web search, it is now very possible. The macro would detect the current setting, figure out which of the above it is (best guess), then set it to the next in the list. The Stacked option is available in PowerPoint and Excel, but not Word. Under Text Box, select the option that you want in the Text direction list. In the Format Shape pane, click Size/Layout & Properties. On the shortcut menu, select Format Shape. Page border measured from the edge of the page (24 pt all around). Right-click the edge of the shape or text box. Close Word’s VBA editor by going to File, Close and Return to Microsoft Word. Solutions to problems that once solved, never should be a problem for you again. Page border measured from the text (1 pt all around).Delete all the text that’s there (everything from Sub to End Sub) and paste your macro script into the VBA editor. It will show you where to paste your macro (look for the section that has the same name as the macro you just named). Copy the macro script and paste it into Word’s VBA.
If you want a single border around the text, click Outside Borders. Select the type of border you want to use. On the Home tab, click the down arrow on the border to get border options, like those shown in the picture. You will now be taken to Word’s VBA editor. Highlight the text you want to create a border around. Be sure your name has no spaces between words.