(Context: I'm a writing instructor and occasionally have to use this feature to comment on emailed submissions of essays written in Microsoft Word. The default font & size is the system's default font (Ubuntu for me) in 10pt, but I wanted the comments to imitate Word's default, which is 9pt Calibri. After searching around, there didn't seem to be an easy solution, so I figured out this quick workaround.)
First, since I wanted to use Calibri, which is the default for Word since 2007, I followed the instructions here.
That done, I went through the following steps to record a macro of inserting a comment and changing the font & size:
- Tools --> Macros --> Record Macro
- Insert --> Comment (or Ctrl + Alt + N)
- Change font and font size as you wish
- Stop recording. Save the macro as whatever (should be in My Macros/Standard/Module1). I called mine 'note_calibri9'.
- Tools --> Macros --> Organize Macros --> OpenOffice.org Basic...
- Find the macro you just recorded and press 'Edit'.
- You should see something very close to the following code. Take note of the line below the third dashed line:
Code: Select all
sub note_calibri9 rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- rem dispatcher.executeDispatch(document, ".uno:InsertAnnotation", "", 0, Array()) rem ---------------------------------------------------------------------- dim args2(4) as new com.sun.star.beans.PropertyValue args2(0).Name = "CharFontName.StyleName" args2(0).Value = "" args2(1).Name = "CharFontName.Pitch" args2(1).Value = 2 args2(2).Name = "CharFontName.CharSet" args2(2).Value = -1 args2(3).Name = "CharFontName.Family" args2(3).Value = 5 args2(4).Name = "CharFontName.FamilyName" args2(4).Value = "Calibri" dispatcher.executeDispatch(document, ".uno:CharFontName", "", 0, args2()) rem ---------------------------------------------------------------------- dim args3(2) as new com.sun.star.beans.PropertyValue args3(0).Name = "FontHeight.Height" args3(0).Value = 9 args3(1).Name = "FontHeight.Prop" args3(1).Value = 100 args3(2).Name = "FontHeight.Diff" args3(2).Value = 0 dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, args3()) end sub
- Remove the 'rem ' from the beginning of the line that mentions 'InsertAnnotation' -- it should look like this:
That 'rem' stands for 'remark', just like the <!-- ... --> in HTML or the % in LaTeX. For some reason, Ooo's macro recorder registers inserting a comment but disregards it by commenting it out in the code.Code: Select all
rem ---------------------------------------------------------------------- dispatcher.executeDispatch(document, ".uno:InsertAnnotation", "", 0, Array())
- Tools --> Customize..., find Keyboard tab
- Find the macro module in the Category box at the bottom (OpenOffice.org Macros/user/Standard/Module1), then find your new macro in the Function box just to the right and select it.
- Back up in the Shortcut Keys box, select Ctrl + Alt + N (or any other keystroke you want) and press 'Modify' on the right. Click OK to exit the dialog.
NOTE: I discovered recently that Ooo does not save comments or inserted OLE objects when editing a Word XML (.docx) file. This is probably a bug (not sure if known), but for now I'm reverting all of these files to the older .doc.