Open a HTM document from Autocad

Open a HTM document from Autocad

Anonymous
Not applicable
158 Views
7 Replies
Message 1 of 8

Open a HTM document from Autocad

Anonymous
Not applicable
I am launching internet explorer from within cad but I do not know how to
open a specific URL once Internet explorer is up.

I tried:

Public Sub OpenIE()

Dim IE As Object 'IE application object
On Error Resume Next 'Get IE
Set IE = GetObject(, "InternetExplorer.Application") 'Get IE if Open
If Err <> 0 Then
Err.Clear
Set IE = CreateObject("InternetExplorer.Application") 'Launch IE
if not Open
If Err <> 0 Then
MsgBox "Could not load InternetExplorer.", vbExclamation
End
End If
End If

IE.Visible = True 'Bring IEto the front
*******************
I thought this would do it?!

IE.LocationURL = "c:\adt2.htm"
*********************
End Sub

Any comments would be greatly appreciated.

--
Michael LaQuire
Arthur Ruteberg Homes, Inc.
Cad Trainer
mlaquire@arhomes.com
0 Likes
159 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Wow! That is a long way to go. Try this instead:

(command "browser" "c:\\adt2.htm")

--
Get free software and more at http://www2.stonemedia.com/~franko

"Michael LaQuire" wrote in message
news:874oni$csc31@adesknews2.autodesk.com...
> I am launching internet explorer from within cad but I do not know how to
> open a specific URL once Internet explorer is up.
>
> I tried:
>
> Public Sub OpenIE()
>
> Dim IE As Object 'IE application object
> On Error Resume Next 'Get IE
> Set IE = GetObject(, "InternetExplorer.Application") 'Get IE if Open
> If Err <> 0 Then
> Err.Clear
> Set IE = CreateObject("InternetExplorer.Application") 'Launch IE
> if not Open
> If Err <> 0 Then
> MsgBox "Could not load InternetExplorer.", vbExclamation
> End
> End If
> End If
>
> IE.Visible = True 'Bring IEto the front
> *******************
> I thought this would do it?!
>
> IE.LocationURL = "c:\adt2.htm"
> *********************
> End Sub
>
> Any comments would be greatly appreciated.
>
> --
> Michael LaQuire
> Arthur Ruteberg Homes, Inc.
> Cad Trainer
> mlaquire@arhomes.com
>
>
0 Likes
Message 3 of 8

Anonymous
Not applicable
Glad to help.

--
Get free software and more at http://www2.stonemedia.com/~franko

"Michael LaQuire" wrote in message
news:874pfo$d5p13@adesknews2.autodesk.com...
> Thanks Frank, Just what I needed. I did not know about the browser
command.
> Always learning.
>
> --
> Michael LaQuire
> Arthur Ruteberg Homes, Inc.
> Cad Trainer
> mlaquire@arhomes.com
> Frank Oquendo wrote in message
> news:874p9g$d6j33@adesknews2.autodesk.com...
> > Wow! That is a long way to go. Try this instead:
> >
> > (command "browser" "c:\\adt2.htm")
> >
> > --
> > Get free software and more at http://www2.stonemedia.com/~franko
> >
> > "Michael LaQuire" wrote in message
> > news:874oni$csc31@adesknews2.autodesk.com...
> > > I am launching internet explorer from within cad but I do not know how
> to
> > > open a specific URL once Internet explorer is up.
> > >
> > > I tried:
> > >
> > > Public Sub OpenIE()
> > >
> > > Dim IE As Object 'IE application object
> > > On Error Resume Next 'Get IE
> > > Set IE = GetObject(, "InternetExplorer.Application") 'Get IE if
> Open
> > > If Err <> 0 Then
> > > Err.Clear
> > > Set IE = CreateObject("InternetExplorer.Application")
'Launch
> IE
> > > if not Open
> > > If Err <> 0 Then
> > > MsgBox "Could not load InternetExplorer.", vbExclamation
> > > End
> > > End If
> > > End If
> > >
> > > IE.Visible = True 'Bring IEto the front
> > > *******************
> > > I thought this would do it?!
> > >
> > > IE.LocationURL = "c:\adt2.htm"
> > > *********************
> > > End Sub
> > >
> > > Any comments would be greatly appreciated.
> > >
> > > --
> > > Michael LaQuire
> > > Arthur Ruteberg Homes, Inc.
> > > Cad Trainer
> > > mlaquire@arhomes.com
> > >
> > >
> >
> >
>
>
0 Likes
Message 4 of 8

Anonymous
Not applicable
Thanks Frank, Just what I needed. I did not know about the browser command.
Always learning.

--
Michael LaQuire
Arthur Ruteberg Homes, Inc.
Cad Trainer
mlaquire@arhomes.com
Frank Oquendo wrote in message
news:874p9g$d6j33@adesknews2.autodesk.com...
> Wow! That is a long way to go. Try this instead:
>
> (command "browser" "c:\\adt2.htm")
>
> --
> Get free software and more at http://www2.stonemedia.com/~franko
>
> "Michael LaQuire" wrote in message
> news:874oni$csc31@adesknews2.autodesk.com...
> > I am launching internet explorer from within cad but I do not know how
to
> > open a specific URL once Internet explorer is up.
> >
> > I tried:
> >
> > Public Sub OpenIE()
> >
> > Dim IE As Object 'IE application object
> > On Error Resume Next 'Get IE
> > Set IE = GetObject(, "InternetExplorer.Application") 'Get IE if
Open
> > If Err <> 0 Then
> > Err.Clear
> > Set IE = CreateObject("InternetExplorer.Application") 'Launch
IE
> > if not Open
> > If Err <> 0 Then
> > MsgBox "Could not load InternetExplorer.", vbExclamation
> > End
> > End If
> > End If
> >
> > IE.Visible = True 'Bring IEto the front
> > *******************
> > I thought this would do it?!
> >
> > IE.LocationURL = "c:\adt2.htm"
> > *********************
> > End Sub
> >
> > Any comments would be greatly appreciated.
> >
> > --
> > Michael LaQuire
> > Arthur Ruteberg Homes, Inc.
> > Cad Trainer
> > mlaquire@arhomes.com
> >
> >
>
>
0 Likes
Message 5 of 8

Anonymous
Not applicable
Ok For the rest of us that are a little on the slow side, how do you use
that within VBA? Do you use the sendkeys command?

BTW I had opened IE from the command line with that, then I tried to use it
with sendkeys, and experienced my first Blue Screen in a long time.
Probably coinckadink but made me decide to ask more

--
Kent Keller
Strobe Data Inc.
www.strobedata.com

To every complex problem there is an easy answer;
and it is wrong!
"Frank Oquendo" wrote in message
news:874pv7$d6j34@adesknews2.autodesk.com...
> Glad to help.
>
> --
> Get free software and more at http://www2.stonemedia.com/~franko
0 Likes
Message 6 of 8

Anonymous
Not applicable
Try this. Be sure to add a reference to the Microsoft Internet Controls to
your project first:

Public Function LaunchBrowser(sURL As String)

Dim obj As InternetExplorer

Set obj = New InternetExplorer
obj.Navigate sURL
obj.Visible = True

End Function

--
Get free software and more at http://www2.stonemedia.com/~franko

"Kent Keller" wrote in message
news:874san$d5d34@adesknews2.autodesk.com...
> Ok For the rest of us that are a little on the slow side, how do you use
> that within VBA? Do you use the sendkeys command?
>
> BTW I had opened IE from the command line with that, then I tried to use
it
> with sendkeys, and experienced my first Blue Screen in a long time.
> Probably coinckadink but made me decide to ask more
>
> --
> Kent Keller
> Strobe Data Inc.
> www.strobedata.com
>
> To every complex problem there is an easy answer;
> and it is wrong!
> "Frank Oquendo" wrote in message
> news:874pv7$d6j34@adesknews2.autodesk.com...
> > Glad to help.
> >
> > --
> > Get free software and more at http://www2.stonemedia.com/~franko
>
>
>
0 Likes
Message 7 of 8

Anonymous
Not applicable
Frank

Meant to post this here, instead of buzzing your mailbox.

What if you don't know what browser a person will have? Is there a way
around that in VBA?

--
Kent Keller
Strobe Data Inc.
www.strobedata.com

To every complex problem there is an easy answer;
and it is wrong!
"Frank Oquendo" wrote in message
news:874uj3$d6533@adesknews2.autodesk.com...
> Try this. Be sure to add a reference to the Microsoft Internet Controls to
> your project first:
>
> Public Function LaunchBrowser(sURL As String)
>
> Dim obj As InternetExplorer
>
> Set obj = New InternetExplorer
> obj.Navigate sURL
> obj.Visible = True
>
> End Function
>
> --
> Get free software and more at http://www2.stonemedia.com/~franko
>
> "Kent Keller" wrote in message
> news:874san$d5d34@adesknews2.autodesk.com...
> > Ok For the rest of us that are a little on the slow side, how do you
use
> > that within VBA? Do you use the sendkeys command?
> >
> > BTW I had opened IE from the command line with that, then I tried to use
> it
> > with sendkeys, and experienced my first Blue Screen in a long time.
> > Probably coinckadink but made me decide to ask more
> >
> > --
> > Kent Keller
> > Strobe Data Inc.
> > www.strobedata.com
> >
> > To every complex problem there is an easy answer;
> > and it is wrong!
> > "Frank Oquendo" wrote in message
> > news:874pv7$d6j34@adesknews2.autodesk.com...
> > > Glad to help.
> > >
> > > --
> > > Get free software and more at http://www2.stonemedia.com/~franko
> >
> >
> >
>
>
0 Likes
Message 8 of 8

Anonymous
Not applicable
This will call the default browser.

Option Explicit

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

Public Const SW_SHOWNORMAL = 1

Sub main()

Dim result As Long

result = ShellExecute(0, "open", "http://visual-engineering.com/", 0&, 0&,
SW_SHOWNORMAL)

Ens Sub

--
Alexander Medwedew
http://visual-engineering.com/

Kent Keller wrote in message <875411$fdh9@adesknews2.autodesk.com>...
>
>What if you don't know what browser a person will have? Is there a way
>around that in VBA?
>
0 Likes