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? Many thanks! Best regards! Jojo