Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acad 2005 - Open a browser from Autocad 1

Status
Not open for further replies.

SeanSweeney

Civil/Environmental
Mar 16, 2005
173
I want to be able to open a web browser direct to a certain website from autocad and preferably from toolpaletts. This can be useful for product catalogues and with the toolpaletts being shared by all the users its a better way than direct to favourites etc.

Any ideas?
 
Replies continue below

Recommended for you

On the command line typr "browser".
 
(command "BROWSER" "

and from the ACADX site...
---------------------------------------------------------------
ShellExecute can be used to launch the application associated with any registered file type but I'll concentrate specifically on launching the default browser or email client. Add the following code to a standard module or class module in your project:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Const SW_SHOW = 5
Private Const SW_SHOWDEFAULT = 10
Private Const SW_SHOWMAXIMIZED = 3
Private Const SW_SHOWMINIMIZED = 2
Private Const SW_SHOWMINNOACTIVE = 7
Private Const SW_SHOWNA = 8
Private Const SW_SHOWNOACTIVATE = 4
Private Const SW_SHOWNORMAL = 1

Public Sub LaunchBrowser(sURL As String, Optional State as Long = SW_SHOW)

ShellExecute 0&, "Open", sURL, 0&, 0&, State

End Sub



Now when you want to launch the browser, just call LaunchBrowser with the address you wish to visit. To launch the default email client, pass a mailto: URL.

"Everybody is ignorant, only on different subjects." — Will Rogers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor