Opening a web page using VB

H

halfawake

I have written a script to check if people are opening word documents from
email. All it really does is check the path, if it is in the temp directory
it ask them if they want to save the document to the document managment
system. We recently changed our DM to a web based system. With this I was
trying to modify my script to save to the new dm. All I really need to do is
have the script open a .asp web page that has the document path in the url. I
can format the url I just can't get VBA to open a web page. Not even
google.com. I looked all over the web ie.. googled it, microsoft.com, and the
ms vip pages without any luck. I was wondering if anybody knew how to do
this. Just so you know we use word 2003.
 
G

George Lee

You can’t do it directly, but rather you have to use a Windows call:

Const SW_SHOWNORMAL = 1
Private Declare Function apiShellExecute 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 Sub GotoWebSite()
Call apiShellExecute(0, "open", "http://google.com", vbNullString,
"c:\", SW_SHOWNORMAL)
End Sub
 
J

Jean-Guy Marcil

halfawake said:
I have written a script to check if people are opening word documents from
email. All it really does is check the path, if it is in the temp directory
it ask them if they want to save the document to the document managment
system. We recently changed our DM to a web based system. With this I was
trying to modify my script to save to the new dm. All I really need to do is
have the script open a .asp web page that has the document path in the url. I
can format the url I just can't get VBA to open a web page. Not even
google.com. I looked all over the web ie.. googled it, microsoft.com, and the
ms vip pages without any luck. I was wondering if anybody knew how to do
this. Just so you know we use word 2003.

I guess your name is appropriate ;-)
I mean, you did not search very hard... if, as you state,all you want is to
open a web page from VBA, than all you need is:

ActiveDocument.FollowHyperlink ("http://www.google.com")
 
J

jokobe

Hi Jean-Guy,

is this posible: to start the google search-page and insert highlighted text
from a word document?

thx in advance...

jokobe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top