Skip to main content.

Fanatic Attack is about entrancement, entertainment, and an enhancement of curiosity.

 

Inserting Special Symbols & Characters into an OpenOffice.org Writer Document

category: Open Source

by Dmitri Popov

Let’s say you wrote a tutorial on using a software application, and you would like to use a proper arrow symbol to separate menu items, for example: Tool arrow image replacing code Option arrow image replacing code OpenOffice.org. A quick solution to the problem is to create a replacement rule that replaces, for example, the “arrow image replacing code” string with a proper arrow symbol. To do this, you have to find the arrow symbol first, and Wikipedia can help you with this. The following Wikipedia pages contain not only arrows, but also other symbols you might find useful:

http://en.wikipedia.org/wiki/Arrow_%28symbol%29

http://en.wikipedia.org/wiki/Miscellaneous_symbols

http://en.wikipedia.org/wiki/Miscellaneous_Technical_%28Unicode%29

Locate the right arrow symbol, select and copy it into the clipboard. In OpenOffice.org, choose Tools ? AutoCorrect, and click on the Replace tab. Enter “arrow image replacing code” (sans quotes) in the Replace field, and paste the arrow symbol into the With field. Press the New button to create the specified replacement rule. Switch to the Options tab, and make sure that the Use replacement table option is enabled. Press OK, type “arrow image replacing code“, press Enter, and the string will be replaced with the arrow symbol.click on the Replace tab. Enter “arrow image replacing code” (sans quotes) in the Replace field, and paste the arrow symbol into the With field. Press the New button to create the specified replacement rule. Switch to the Options tab, and make sure that the Use replacement table option is enabled. Press OK, type “arrow image replacing code“, press Enter, and the string will be replaced with the arrow symbol.

Creating a replacement rule is one way to go. Another solution is to write a simple OpenOffice.org Basic macro, which inserts a specified symbol into the current document. To do this, you have to find the ASCII code for the desired symbol first. To take care of this, you can use the following simple macro:

SubConvertToASCII
Symbol=InputBox("Enter symbol or character:", "Convert to ASCII")
ASCIICode=Asc(Symbol)
MsgBox "The ASCII code for the entered symbol is: " & ASCIICode
End Sub

Copy the desired symbol (e.g., right arrow) from the Wikipedia page, run the macro, and paste the symbol into the input field. Press OK, and the macro displays the ASCII code of the pasted symbol. For example, the ASCII code for the right arrow is 8594, and you can use it in the macro that inserts the specified special character or symbol into the currently opened document:

Sub InsertUnicodeCharacter

ThisDoc = ThisComponent
Controller = ThisDoc.getCurrentController()
TextCursor = Controller.getViewCursor()

Character = Chr("8594")

TextCursor.setString(Character)
TextCursor.goRight(1, false)

End Sub

If you want the macro to insert any other symbol or character, you can do so by replacing the 8594 part with the appropriate ASCII code.

by Dmitri Popov of Nothickmanuals.info

PS: WordPress (or this particular template) isn’t allowing us to type the actual code for the arrow, even with the ‘code’ attribute. Therefore, we used images to replace the arrow code to relay Dmitri’s message.

Posted by FA Editors at 9:57 AM PDT

comments

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>