View Full Version : Macro to close and hyperlink to a web address
francozola25
07-10-2008, 12:08 PM
Hello i am wondering is there a way that i could have a have a macro to a macro that will close word and hyperlink to a web address.
I want to have this macro as a command button on the toolbar.
I don't want run the macro when i close word, only as a command on the toolbar.
CreganTur
07-11-2008, 12:06 PM
Here's a good article from the Office Experts that talks about creating a custom toolbar and adding custom buttons: http://www.theofficeexperts.com/VBASamples/Word01.htm.
You can use this to create the toolbar and the button that you want for your macro.
close word and hyperlink to a web address.
This code will close the Active Document on Word, and will then follow a hyperlink.
ActiveDocument.Close
Application.FollowHyperlink "http:\\www.vbaexpress.com", , True
You could use Application.Quit to exit word, but this will kill Word as a whole, which means it would close other documents that may be open, which is not a good idea, since your users could potentially have other docs open that they don't want you to force-quit :whistle:
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.