Back in VBA for Word, I could simply supply a template name, rather than a complete path\filename. I've tried many variations on the following. but all they do is take me to the Template dialog ... and wait for me to click on a specific template. The sparce documentation I've found says that TemplateRegionName should be set to name that appears in the dialog. I suspect the problem lies there.
Code: Select all
sub Launch
dim document as object
dim dispatcher as object
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "TemplateRegionName"
args1(0).Value = "My Templates"
args1(1).Name = "TemplateName"
args1(1).Value = "10Envelope"
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:NewDoc", "", 0, args1())
end sub
Thanks,
Ron Benrey