PBB: Word 2007 Macro to speed up tagging of Headwords

Page 1 of 1 (1 items)
This post has 0 Replies | 0 Followers

Posts 2765
DominicM | Forum Activity | Posted: Sun, Aug 7 2011 8:29 AM | Locked

Ok if you dont know what a macro is - read no futher - if you do you will know what to do with it

Put cursor on the Start of the Header line you wish to tag as a headword

----SCRIPT--BEGIN----

Sub AddHeadword()
'
' AddHeadword Macro
'
'
    Selection.EndKey Unit:=wdLine, Extend:=wdExtend
    Selection.Copy
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    Selection.MoveDown Unit:=wdLine, Count:=1
    Selection.TypeText Text:="[[@Headword:"
    Selection.PasteAndFormat (wdPasteDefault)
    Selection.MoveUp Unit:=wdLine, Count:=1
    Selection.EndKey Unit:=wdLine, Extend:=wdExtend
    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    Selection.MoveDown Unit:=wdLine, Count:=1
    Selection.MoveUp Unit:=wdLine, Count:=2
    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    Selection.MoveRight Unit:=wdCharacter, Count:=1
    Selection.EndKey Unit:=wdLine
    Selection.TypeText Text:="]]"
    Selection.ClearFormatting
    WordBasic.ClearAllFormatting
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    Selection.HomeKey Unit:=wdLine
End Sub

----SCRIPT--END----

 

-- the only Caveat is it creates a headword for the whole line, but for concordances/dictionaries this is to be expected..   ..and sometimes adds a space between @Headword: and the milestone text, but that is easy removed by a global search and replace for "Headword: ' remember to add space after the colon

If you know what a macro is you will know what to do with it :P

If you can inprove it please do - they are not my strong point

Never Deprive Anyone of Hope.. It Might Be ALL They Have

Page 1 of 1 (1 items) | RSS