Author Topic: Visio 2007 32 bit + VB6 - Open URL  (Read 425 times)

0 Members and 1 Guest are viewing this topic.

dgoogle

  • Jr. Member
  • **
  • Posts: 14
Visio 2007 32 bit + VB6 - Open URL
« on: November 18, 2013, 12: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



Get Visio Guy's new book!


Jumpy

  • Hero Member
  • *****
  • Posts: 1028
Re: Visio 2007 32 bit + VB6 - Open URL
« Reply #1 on: November 18, 2013, 02: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.

Visit the Visio Guy web site at www.visguy.com for hundreds more articles on Visio!


dgoogle

  • Jr. Member
  • **
  • Posts: 14
Re: Visio 2007 32 bit + VB6 - Open URL
« Reply #2 on: November 18, 2013, 04:58:30 PM »
Thanks for the advice, I tried it and it work.


dg