To start with a question—how do you get a macro to open a blank Calc document? Hopefully, you'll answer that you use the function that we wrote in Chapter 6 :
Function open_spreadsheet Dim oURL as String oURL = "private:factory/scalc" open_spreadsheet = starDeskTop.loadComponentFromURL (oURL, _ "_blank", 0, Array() ) End Function
So here's another question—How do you get a macro to open a blank Writer document? Not sure? Let me give you a clue—you can use the same subroutine, but you have to change one word. Give up? Just change:
oURL = "private:factory/scalc"
oURL = "private:factory/swriter"
From this I'm sure you can deduce that it's the URL that determines how a file is opened; this is true ...