Hi everyone.
I ran into another challenge (problem).
I have the need to open an external “www” URL. I have a push button on "MainForm " and I need to open a help page on a website of mine that I am in the progress of building.
On In base how to open a URL field? shows how to open, I assume, an embedded document or page. I need to go out to the web. I tried replacing “txtURL” with the webpage URL and the “Push Button 1” with “btnHelp” I’m sure this line must be revised to reflect an external URL "oField = oForm.getByName(“txtURL”) "
Here is my particulars and the script by Ratslinger from the page above.
Button: btnHelp
URL: https://whitehousecomms-arc.org/
Sub GetURL
oForm = ThisComponent.Drawpage.Forms.getByName(“MainForm”)
DocCtl = ThisComponent.getCurrentController()
oField = oForm.getByName(“txtURL”)
oButton = oForm.getByName(“Push Button 1”)
CtlView = DocCtl.GetControl(oField)
oButton.TargetUrl = CtlView.Text
end sub
EXTRA NOTE: The even better event to execute the macro would be the “get focus” of the push_button itself
This executes the macro only when actually needed (and reads always the actual displayed content of the text field)
Thanks very much! Inquiring minds want to know.