VELTIN Joffrey wrote: > Hi everyone, > > New to this mail list and to OOo community. > > Here is my problem: > > I want to open a particular document from the active document from which I > launch the macro. I use this code: > > '***************************** > ************************************************************** > > > Sub OpenFile (FileName as String) > > dim args(1) as new com.sun.star.beans.PropertyValue > dim FilePath, FileToOpen, FileURL as String > dim TheDoc as Object > > FilePath = "C:\MyRecords\" > FileToOpen= FilePath & FileName & ".ods" > > FileURL=ConvertToURL(FileToOpen) > > args(0).name="InteractionHandler" > args(0).value="" > args(1).name="MacroExecutionMode" > args(1).value=com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN > TheDoc=StarDesktop.loadComponentFromURL(FileURL,"_blank",0,args()) > > > End Sub > > '********************************************************************************************** > > Now, I would like to get access to this newly opened document... let's say I > would like to add a column. > As ThisComponent refers to the initial document, I cannot find a way to > operate on the new document.. Would you have some suggestions?
Sorry, I don't understand. You have "TheDoc" - why can't you use it? Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
