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