1rem ************************************************************* 2rem 3rem Licensed to the Apache Software Foundation (ASF) under one 4rem or more contributor license agreements. See the NOTICE file 5rem distributed with this work for additional information 6rem regarding copyright ownership. The ASF licenses this file 7rem to you under the Apache License, Version 2.0 (the 8rem "License"); you may not use this file except in compliance 9rem with the License. You may obtain a copy of the License at 10rem 11rem http://www.apache.org/licenses/LICENSE-2.0 12rem 13rem Unless required by applicable law or agreed to in writing, 14rem software distributed under the License is distributed on an 15rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16rem KIND, either express or implied. See the License for the 17rem specific language governing permissions and limitations 18rem under the License. 19rem 20rem ************************************************************* 21Attribute VB_Name = "Module1" 22Option Explicit 23 24Sub main() 25 26MsgBox "hallo" 27 28'The service manager is always the starting point 29'If there is no office running then an office is started up 30Dim objServiceManager As Object 31Set objServiceManager = CreateObject("com.sun.star.ServiceManager") 32 33'Create the CoreReflection service that is later used to create structs 34Set objCoreReflection = objServiceManager.createInstance("com.sun.star.reflection.CoreReflection") 35 36'Create the Desktop 37Set objDesktop = objServiceManager.createInstance("com.sun.star.frame.Desktop") 38 39'Open a new empty writer document 40 41Set objCoreReflection = objServiceManager.createInstance("com.sun.star.reflection.CoreReflection") 42'get a type description class for Size 43Set propClass = objCoreReflection.forName("com.sun.star.beans.PropertyValue") 44 45Dim prop 46propClass.CreateObject prop 47prop.Name = "Hidden" 48prop.Value = True 49 50'create the actual object 51Dim args(0) 52Set args(0) = prop 53 54Dim args2() 55'Set objDocument= objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args) 56Set objDocument = objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args2) 57 58End Sub 59