Hello All,
I'm trying to create a button that, when pressed, will launch a URL in the system's (windows 7) default browser. What is the right way to do this?
Thanks
Open URL from OpenOffice macro
Open URL from OpenOffice macro
Windows 7. OpenOffice 4.1.1
Re: Open URL from OpenOffice macro
I drew a button in a Calc document, right clicked on it and selected Control. In the dialog that appeared, on the General tab, there is a category Action. From that drop down list I selected Open Document/URL. The next category is called URL, where you can type in or browse for the desired URL. After taking the button out of design mode, clicking on it brought up the URL in my default browser.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Open URL from OpenOffice macro
To add to FJCC's repy, it can also be helpful to have the URL in a table so that it can be changed easily either directly in the table or by entry into a text box on a form. In the latter case the code below works well.
Set the function to the button's 'Approve action' event.
Regards,
Nocton
Code: Select all
Function openurl(oEv as object)
' to open URL in browser
Dim oForm,oTextBox
oForm=oEv.source.model.parent ' get control's form
oTextBox=oForm.getbyname("txtWebSite")
oEv.source.model.targeturl=oTextBox.text
openurl=true
End Function
Regards,
Nocton
OpenOffice 4.1.12 on Windows 10
Re: Open URL from OpenOffice macro
Slightly different approach in Python with one or many buttons automatically disabled/enabled when changing the record: viewtopic.php?f=13&t=71893&p=323909#p323909
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice