1Attribute VB_Name = "Module1"
2Option Explicit
3
4Sub main()
5
6MsgBox "hallo"
7
8'The service manager is always the starting point
9'If there is no office running then an office is started up
10Dim objServiceManager As Object
11Set objServiceManager = CreateObject("com.sun.star.ServiceManager")
12
13'Create the CoreReflection service that is later used to create structs
14Set objCoreReflection = objServiceManager.createInstance("com.sun.star.reflection.CoreReflection")
15
16'Create the Desktop
17Set objDesktop = objServiceManager.createInstance("com.sun.star.frame.Desktop")
18
19'Open a new empty writer document
20
21Set objCoreReflection = objServiceManager.createInstance("com.sun.star.reflection.CoreReflection")
22'get a type description class for Size
23Set propClass = objCoreReflection.forName("com.sun.star.beans.PropertyValue")
24
25Dim prop
26propClass.CreateObject prop
27prop.Name = "Hidden"
28prop.Value = True
29
30'create the actual object
31Dim args(0)
32Set args(0) = prop
33
34Dim args2()
35'Set objDocument= objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args)
36Set objDocument = objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args2)
37
38End Sub
39