I made some changes to your macro


Dim oProps(2) as New com.sun.star.beans.PropertyValue Dim sUrl As String Dim oDoc

'oDesktop = createUnoService("com.sun.star.frame.Desktop")
'sUrl = "file:///somewhat.sxw"
sUrl = "file:///andrew0/home/andy/My%20Documents/OpenOffice/AndrewFontMacro.odt"
oProps(0).name = "ReadOnly"
oProps(0).value = True
oProps(1).name = "MacroExecutionMode"
oProps(1).value = com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN
oDoc = StarDesktop.LoadComponentFromURL(sUrl, "_default", 0, oProps())


* Place "Option Explicit" at the top of your module so that you must declare every variable.
* I placed quotes around "ReadOnly".
* I used the fullname for the macro execution mode in case they renumbered them (not likely, but just in case)
* I used StarDesktop rather than obtaining a desktop service (it should not make a difference).


I verified that this work using 1.9.87

Helmut Seidel wrote:

hello everybody,

in OO1.1.4 i used the following code to load (database) documents:

...
oDesktop = createUnoService("com.sun.star.frame.Desktop")
sUrl = "file:///somewhat.sxw"
mFileProperties(0).name = ReadOnly
mFileProperties(0).value = True
mFileProperties(1).name = "MacroExecutionMode"
mFileProperties(1).value = 4
oDoc = oDesktop.LoadComponentFromURL(sUrl, "_default", 0, mFileProperties())
...


with this code i am able to load my document AND execute my Basic-Macros which are incorporated in my code.

now i started to port my app to OO2.0 - with this new version it is not possible to execute my macros within the loaded document.

can anybody tell me what to do?

thank you and appologies for my clumpsy english

helmut

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info: http://www.pitonyak.org/oo.php


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to