HI Team,
I want to automate the Open office Writer and add text in opened file in Writer.
I got few sample in that either we are creating all new instance using "private:factory/swriter", or we can load already saved file using file path and add text in it.
But I don't want to save a file(until user wants), and modify the content of Writer file whichever file open in writer, or wherever the cursor is in writer?
Please let me know in case any other details you want?
Thanks,
Mayank Rajpura.
Modify unsaved writer file using .Net C#
-
- Posts: 1
- Joined: Fri May 27, 2022 9:25 am
Modify unsaved writer file using .Net C#
Window 10, Open office 4.1.11
Re: Modify unsaved writer file using .Net C#
The return value of loadComponentFromURL is a reference to the document which you can then use
In Basic as I don't know .Net C#:
Edit:
Alternatively there's thiscomponent
https://wiki.openoffice.org/wiki/Curren ... e_document
In Basic as I don't know .Net C#:
Code: Select all
oDoc=StarDesktop.loadComponentFromURL("private:factory/swriter","_blank",0,Array())
oDoc.gettext.string = "some text"
Alternatively there's thiscomponent
https://wiki.openoffice.org/wiki/Curren ... e_document
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)