| View previous topic :: View next topic |
| Author |
Message |
richhill OOo Advocate


Joined: 16 Jun 2004 Posts: 418 Location: Mesa, AZ
|
Posted: Thu Oct 06, 2005 7:36 am Post subject: Basic: How to: Open web browser from inside macro ? |
|
|
I hope there is a simple way (ie 1 line) to dothis :
Something like openwebbrowser("www.oooforum.org")
Thanks in advance - I'll pay it forward! _________________ OOo Calc tips: http://www.openofficetips.com |
|
| Back to top |
|
 |
probe1 Super User


Joined: 18 Aug 2004 Posts: 2060 Location: Chonburi Thailand Asia
|
Posted: Thu Oct 06, 2005 7:42 am Post subject: |
|
|
Do you mean a OOo function of
Not that I'm aware of.
HTH _________________ Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs |
|
| Back to top |
|
 |
richhill OOo Advocate


Joined: 16 Jun 2004 Posts: 418 Location: Mesa, AZ
|
Posted: Thu Oct 06, 2005 8:00 am Post subject: |
|
|
Probe,
That is what I'm looking for! Just one thing regarding your example - does OOo have some env variable for /path/to/firefox - like BROWSERPATH or something? This needs to be
platform/browser independent - whether it is IE on WinXP or Firefox on Linux
Thanks again! _________________ OOo Calc tips: http://www.openofficetips.com |
|
| Back to top |
|
 |
9point9 Moderator

Joined: 31 Aug 2004 Posts: 3904 Location: UK
|
Posted: Thu Oct 06, 2005 8:26 am Post subject: |
|
|
One way I can think of:
| Code: | | Shell ("about:blank") |
This should start up the default web browser with a blank page. Unfortunately mine keeps going to IE for some terrible reason. _________________ Arch Linux
OOo 3.2.0
OOoSVN, change control for OOo documents:
http://sourceforge.net/projects/ooosvn/ |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 4021 Location: Lawrence, Kansas, USA
|
Posted: Wed Oct 12, 2005 8:07 am Post subject: |
|
|
Funny, I just had to code a macro this morning for one of my co-workers. (on Windows)
| Code: | Sub Main
' This opens an internet browser.
Shell( "cmd.exe /cStart http://www.digg.com" )
' This opens a document on the disk
cQuote = Chr(34)
Shell( "cmd.exe /c" + cQuote + "C:\Documents and Settings\dbrewer\Desktop\util.pdf" + cQuote )
End Sub
|
What I had to code was much larger than this. My coworker had a Base document. One of its fields was a text field with either a URL or a pathname to a document on a fileserver. I had to add two kickable buttons to the database form which would open the document or open a browser to a url. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
lesguilw Power User

Joined: 09 Nov 2005 Posts: 57 Location: Frenchy in Sevilla, Spain
|
Posted: Mon Nov 20, 2006 6:10 am Post subject: |
|
|
If someone has a code for Unix I am interested, if it includes the system detection (whether Windows or Unix) it would be even better.
Cheers,
William |
|
| Back to top |
|
 |
probe1 Super User


Joined: 18 Aug 2004 Posts: 2060 Location: Chonburi Thailand Asia
|
Posted: Mon Nov 20, 2006 6:39 am Post subject: |
|
|
for Unix: use a "shell" command like the example above.
for detecting the operating system see runtime function (F1 help)
Does this help? _________________ Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs |
|
| Back to top |
|
 |
lesguilw Power User

Joined: 09 Nov 2005 Posts: 57 Location: Frenchy in Sevilla, Spain
|
Posted: Tue Nov 21, 2006 4:39 am Post subject: |
|
|
Yes this helped, it put on the track of this very useful post: http://www.oooforum.org/forum/viewtopic.phtml?t=32575&view=previous
But unfortunately I cannot find any Unix shell command to achieve to open a default browser window. Google is not very comprehensive with my query and my favorite Unix experts don't have a clue.
Any simple idea on that? |
|
| Back to top |
|
 |
probe1 Super User


Joined: 18 Aug 2004 Posts: 2060 Location: Chonburi Thailand Asia
|
Posted: Tue Nov 21, 2006 7:45 am Post subject: |
|
|
I'm afraid there is no Unix standard browser....
If you have a defined environment, you could issue a command, but if you don't.... _________________ Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs |
|
| Back to top |
|
 |
lesguilw Power User

Joined: 09 Nov 2005 Posts: 57 Location: Frenchy in Sevilla, Spain
|
Posted: Tue Nov 21, 2006 2:26 pm Post subject: |
|
|
Well... then I guess my Unix users will have to copy/cut the url from a custom message box and that will be it
Cheers,
William |
|
| Back to top |
|
 |
|