Matthias B. wrote:
Hallo, I've checked the Dev Guide and the IDL docs but I can't seem to
find any services/interfaces that allow me to create/edit  Basic
scripts included in a document via the UNO API. It would be nice if
someone could point me in the right direction.

Matthias

Hi, Matthias B.

Sub mkNewDocWithMacro()
oDoc = Stardesktop.loadComponentFromURL("private:factory/swriter","_default",0,Array())
oDocLibs = oDoc.BasicLibraries
oLib = oDocLibs.createLibrary("testLib")
sCode = "REM  *****  BASIC  *****"& Chr(10)
sCode = sCode &"REM inserted by Sub mkNewDocWithMacro()"& Chr(10)
sCode = sCode &"Sub test"& Chr(10)
sCode = sCode &"Msgbox ""Sub test has been called"",64,""Library test"""& Chr(10)
sCode = sCode &"End Sub"
'msgbox sCode,64
oLib.insertByName("Module1",sCode)
REM this is not changed automatically:
oDoc.setModified(True)
End Sub

Does this help?

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

Reply via email to