Fundi OOo Advocate

Joined: 21 Sep 2004 Posts: 278
|
Posted: Thu Oct 21, 2004 1:20 pm Post subject: The code... |
|
|
I hope I dont get shot down for posting so many lines of code but that is the macro as recorded. Thanks for all the trouble in answering. MJ
sub DocInfo
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(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "PageStyle"
args1(0).Value = "Default"
args1(1).Name = "On"
args1(1).Value = true
dispatcher.executeDispatch(document, ".uno:InsertPageFooter", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(5) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Type"
args2(0).Value = 2
args2(1).Name = "SubType"
args2(1).Value = 0
args2(2).Name = "Name"
args2(2).Value = ""
args2(3).Name = "Content"
args2(3).Value = ""
args2(4).Name = "Format"
args2(4).Value = 1
args2(5).Name = "Separator"
args2(5).Value = " "
dispatcher.executeDispatch(document, ".uno:InsertField", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "Text"
args3(0).Value = ", "
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args3())
rem ----------------------------------------------------------------------
dim args5(5) as new com.sun.star.beans.PropertyValue
args5(0).Name = "Type"
args5(0).Value = 0
args5(1).Name = "SubType"
args5(1).Value = 1
args5(2).Name = "Name"
args5(2).Value = "1"
args5(3).Name = "Content"
args5(3).Value = ""
args5(4).Name = "Format"
args5(4).Value = 5080
args5(5).Name = "Separator"
args5(5).Value = " "
dispatcher.executeDispatch(document, ".uno:InsertField", "", 0, args5())
rem ----------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "Text"
args6(0).Value = ", Page "
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args6())
rem ----------------------------------------------------------------------
dim args7(5) as new com.sun.star.beans.PropertyValue
args7(0).Name = "Type"
args7(0).Value = 5
args7(1).Name = "SubType"
args7(1).Value = 5
args7(2).Name = "Name"
args7(2).Value = ""
args7(3).Name = "Content"
args7(3).Value = ""
args7(4).Name = "Format"
args7(4).Value = 7
args7(5).Name = "Separator"
args7(5).Value = " "
dispatcher.executeDispatch(document, ".uno:InsertField", "", 0, args7())
rem ----------------------------------------------------------------------
dim args8(0) as new com.sun.star.beans.PropertyValue
args8(0).Name = "Text"
args8(0).Value = " of "
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args8())
rem ----------------------------------------------------------------------
dim args9(5) as new com.sun.star.beans.PropertyValue
args9(0).Name = "Type"
args9(0).Value = 6
args9(1).Name = "SubType"
args9(1).Value = 0
args9(2).Name = "Name"
args9(2).Value = ""
args9(3).Name = "Content"
args9(3).Value = ""
args9(4).Name = "Format"
args9(4).Value = 7
args9(5).Name = "Separator"
args9(5).Value = " "
dispatcher.executeDispatch(document, ".uno:InsertField", "", 0, args9())
end sub |
|