


Here’s the code: Set objWord = CreateObject(“Word.Application”)Īnd here’s what the resulting document looks like: You can easily modify the script to give yourself a catalog of symbols for Wingdings2, Wingdings3, Webdings, Bookdings, and any other ding-dang font you want. Here’s a script that creates a Word document containing all the symbols and their character codes found in the Wingdings font (character codes 32 through 255). If you like using symbols it might be worth your while to create a catalog of symbols and their character codes. Run the script, and you should see a smiley face in your document.
#Advanced symbols word for mac code#
That’s it: we call the InsertSymbol method followed by the desired character code and the desired font. We call the Add() method to create a new document, then create an instance of the Word Selection object.Īt that point all we need is one line of code in order to insert the smiley face symbol: objSelection.InsertSymbol 74, “Wingdings” We begin by creating an instance of the Word.Application object, and then set the Visible property to True. ObjSelection.InsertSymbol 74, “Wingdings” Now that we know the font we want to use (Wingdings) and the character code for our symbol (74), we’re ready to write a script that inserts the smiley face into a Word document: Set objWord = CreateObject(“Word.Application”) When we do so, the character code for the smiley face is listed in the Character code box. Perhaps the easiest way to do this (although we’ll show you another method at the end of today’s column) is to open up the Symbol dialog box, select the desired font, and then click on the symbol you want to insert:Īs you can see, we’ve selected the smiley face. (No, we don’t know why we liked it, we just did.) Second – and by far most important – this is an easy one, one we can answer with just a few lines of code.Īs we’ll see, the code for inserting a symbol into a Word document is trivial what’s tricky is figuring out which symbol you want to insert (as well as the character code for that symbol). First, we just liked the phrase insert a Wingding symbol. In case you’re wondering, there were two reasons why we decided to answer your question. For instance, if you wanted to search for a capital A, whose ASCII value is 65, you would use ^0065 as your search string.Hey, Scripting Guy! How can I insert a Wingding symbol into a Word document? (You can find ASCII values for characters in the back of many programming books.) All you need to do is use the caret, followed by a zero and then the three-digit value of the character. In addition, Word allows you to search for any character as long as you know its ASCII value. You cannot, however, use the special white space character (^w) in the Replace With box. You can also use many of these same special characters in the Replace With box when doing a search and replace operation. The following is a list of the more common special characters: Special Character It can be faster to remember these and type them in rather then looking them up all of the time. Often, you will be searching for other special characters such as breaks and paragraph marks. Set other searching parameters, as desired.Alternatively, you can click on the Special button and select a special character from the list. For example, to search for a tab character enter ^t (it is important to use a lowercase t). In the Find What box, enter the text for which you want to search.The Find tab of the Find and Replace dialog box. In Microsoft Word 2007 and later, the Show All icon is on the Home tab, in the Paragraph section. If this toolbar is not visible, click View, Toolbars, and select Standard. To enable or disable this feature, click the Show All, or pilcrow, icon on the standard toolbar. Click the More button, if it is available. The image also displays example text with the main formatting symbols.Word displays the Find tab of the Find and Replace dialog box. If you are working with documents that use tabular material, you will find yourself searching for tab characters quite a bit. Word allows you to search not just for text, but also for special characters that normally do not print.
