Last active
April 30, 2018 11:16
-
-
Save dajare/f2fd1b8d378d4fb745af37769c598142 to your computer and use it in GitHub Desktop.
LibreOffice macro to insert "number range" user variable field + surrounding text -- recorded on OSX 10.10.5 with LibO Vanilla 6.0.3.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub PatentParaNum | |
' recorded on OSX 10.10.5 | |
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 ---------------------------------------------------------------------- | |
dim args1(0) as new com.sun.star.beans.PropertyValue | |
args1(0).Name = "Text" | |
args1(0).Value = "[00" | |
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args1()) | |
rem ---------------------------------------------------------------------- | |
dim args2(0) as new com.sun.star.beans.PropertyValue | |
args2(0).Name = "Group" | |
args2(0).Value = "mytexts*1" | |
dispatcher.executeDispatch(document, ".uno:SetActGlossaryGroup", "", 0, args2()) | |
rem ---------------------------------------------------------------------- | |
dim args3(0) as new com.sun.star.beans.PropertyValue | |
args3(0).Name = "Group" | |
args3(0).Value = "mytexts*1" | |
dispatcher.executeDispatch(document, ".uno:SetActGlossaryGroup", "", 0, args3()) | |
rem ---------------------------------------------------------------------- | |
dim args4(0) as new com.sun.star.beans.PropertyValue | |
args4(0).Name = "Group" | |
args4(0).Value = "mytexts*1" | |
dispatcher.executeDispatch(document, ".uno:SetActGlossaryGroup", "", 0, args4()) | |
rem ---------------------------------------------------------------------- | |
dim args5(1) as new com.sun.star.beans.PropertyValue | |
args5(0).Name = "Group" | |
args5(0).Value = "mytexts*1" | |
args5(1).Name = "ShortName" | |
args5(1).Value = "M+" | |
dispatcher.executeDispatch(document, ".uno:InsertGlossary", "", 0, args5()) | |
rem ---------------------------------------------------------------------- | |
dim args6(0) as new com.sun.star.beans.PropertyValue | |
args6(0).Name = "Text" | |
args6(0).Value = "] " | |
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args6()) | |
end sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Responding to this question on AskLibO: "4 digit paragraph enumeration"