Run VBA on Open

B

Brian Shafer

an example would be like...
Public Sub NotifyUser()
dim intMSG as integer

intMSG = msgbox("Would you like to sign my guestbook now?")

if intmsg = vbYes then
Open the web page
end if
That would lead to another question, How would I open a web page in vba,
with frontpage?
Thanks,
Brian
 
S

Steve Easton

Sorry for the delay. Been chasing a
"computer bug."
( very well hidden Trojan "bot" actually )

When I read your original post I was thinking javascript,
which can do what you want very easily. vbs didn't "register"
( Also I have yet to get "into" visual basic )
( got visual studio for Christmas though )

Now that I've bored you with useless drivel,
my next question ( recommendation ) is:
simply place a guest book "link" on the page,
because <imho> if you hit folks with it when the
page opens they will instinctively click No.!!!
( also they may get hit with the "allow scripts to
run" prompt which they will decline )

As I said, it's my humble opinion.
 
B

Brian Shafer

Thanks, useful thoughts.. probly right about just selecting no.. I know I
do. Thanks for your time.
Merry Christmas btw..
which version of VS do you have? Love VS 6.0... Need to start getting into
VS.net... C# is what I want to learn now..
Brian
 
S

Stefan B Rusynko

VBA is not supported by browsers

IMHO, most users should have some sort of effective popup blocking to prevent unclicked popup windows




| an example would be like...
| Public Sub NotifyUser()
| dim intMSG as integer
|
| intMSG = msgbox("Would you like to sign my guestbook now?")
|
| if intmsg = vbYes then
| Open the web page
| end if
| That would lead to another question, How would I open a web page in vba,
| with frontpage?
| Thanks,
| Brian
|
| | > Depends upon what you want the script to do.
| >
| > Can we have a little more info.
| >
| > --
| > using 2k PRO but....95isalive
| > This site is best viewed............
| > .......................with a computer
| >
| > | > > How do I run VBA code when page opens?
| > > Brian
| > >
| > >
| >
| >
|
|
 
M

MD WebsUnlimited.com

Hi Brian,

It is unclear if you wish the code to run when it is opened in FP or when it
is opened in a Browsers.

The first can be accomplished by using FP VBA Macro and hooking page open
event or a number of other events such as
onpagenew, onpageclose, onpage, onpageactiviate, onwebclose....... and
more.

When runing VB code in a web page it is no VBA but VBS, VBA was specificialy
designed to work in applications. To run VBS when a page opens and is fully
rendered you'd use something like:

<script for="body" event="onload" language="vbscript">
window.location = "newpage.htm"
end sub
 

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