Replacing dingbats

I _really_ should have blogged this when I first wrote it. That would’ve saved me time writing it again!

Sub ReplaceDingbats(optional doc)
	oDocument = IIf(IsMissing(doc), ThisComponent, doc)
	oSearchDesc = oDocument.createSearchDescriptor	
	for i = 1 to 9 
		oSearchDesc.searchString = "(;; )?\(" + i + "\)"
		oSearchDesc.searchRegularExpression = true
		mFound = oDocument.findFirst(oSearchDesc)
		do while not isNull(mFound)
			mFound.string = chr(&HF08B + i)
			mFound.CharFontName = "Wingdings"
			mFound = oDocument.findNext(mFound.End, oSearchDesc)
	next i
End Sub

It’s a macro for – replaces the widgets I use in formatting the book chapter…

2 responses to “ Replacing dingbats”

  1. Knusper says:

    You use emacs, but write your book with Open Office… I don’t get it. Have you ever tried Auctex?

  2. Sacha Chua says:

    I use Org in Emacs to draft everything, then I export it as HTML, then I open up the HTML and copy it into so that I can format it according to the publisher’s template, making liberal use of Org and tweaks to make my life easier. =) Does that make sense now? Wouldn’t do it if it didn’t need formatting.

    I used to write my lab reports using auctex. That was quite fun, actually.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>