Visio Guy

Visio Discussions => Programming & Code => Topic started by: dgoogle on November 18, 2013, 05:11:08 AM

Title: Visio 2007 32 bit + VB6 - Open URL
Post by: dgoogle on November 18, 2013, 05:11:08 AM
hi all,
I have setup my own menu  button and have been able to get it to run some macros (eg resize apage).

Now I need to add a button to the menu that will launch my default browser and go to a specific URL.

The base code I am working from is:
With cbcCustomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "Open URL"
.OnAction = "https://google.com" <----- I know this does not work but its to illustrate the type of thing I would like to do.
End With

Is there a call out that can be used eg OpenURL or some such thing ?

Also is there a way to:
1. change the colour of the menu title ?
2. Add a bar between menut items ?

cheers,
dg


Title: Re: Visio 2007 32 bit + VB6 - Open URL
Post by: Jumpy on November 18, 2013, 07:57:03 AM
You could use the OnAction of the Button to start a macro and in the macro you open the browser with your URL. Inside Macro/VBA you could use ShellExecute function.
Title: Re: Visio 2007 32 bit + VB6 - Open URL
Post by: dgoogle on November 18, 2013, 09:58:30 PM
Thanks for the advice, I tried it and it work.


dg