OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 15-08-2010, 14:44
PAnderson PAnderson is offline
Member
 
Join Date: Nov 2003
Posts: 47
Default Add a hyperlink in a User form

How do I make a hyperlink for a text label on a user form? I have done this several times on forms, but my link does not seem to be working in Windows 7. It returns a Compile Error and says "Sub or Function not defined."

What am I missing?

Code:
Private Sub label_weblink_Click()

ShellExecute 0, "Open", "http://www.websitelink.com/", "", "", vbNormal

End Sub
Patti
Reply With Quote
  #2  
Old 15-08-2010, 15:09
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.

You'll need to put this at the top of the module.

Code:
Private Declare Function ShellExecute 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
-John
Reply With Quote
  #3  
Old 15-08-2010, 16:09
PAnderson PAnderson is offline
Member
 
Join Date: Nov 2003
Posts: 47
Default

That did it! Thanks, John!

I don't remember adding that code at the top before with some of my older macros (which doesn't mean it wasn't supposed to be there!). At the risk of asking a dumb question...Is that standard or something new?

This is the kind of stuff I just don't know about not having any background in VBA other than books and the help that comes with CD.

Patti
Reply With Quote
  #4  
Old 15-08-2010, 17:32
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
It was probably there and you didn't notice. It basically just tells the macro where to find the function since this isn't a standard vba function. Windows functions are stored in .dlls so it refers to shell32.dll to find it.

-John
Reply With Quote
  #5  
Old 15-08-2010, 19:54
PAnderson PAnderson is offline
Member
 
Join Date: Nov 2003
Posts: 47
Default

Thanks again, John! This is the kind of info I'll definitely be adding to by notes.

Patti
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a shape on a user form? Gadget CorelDRAW/Corel DESIGNER VBA 2 16-01-2008 03:18
Hyperlink text??? KennyMike General 1 24-08-2007 14:46
[Newbie] User Form Revisited Booker CorelDRAW/Corel DESIGNER VBA 1 16-12-2005 20:08
CD11: Adding input from user form to document ddonnahoe Code Critique 2 09-04-2004 12:43
Hyperlink or run file in VBA Michael Cervantes CorelDRAW/Corel DESIGNER VBA 2 06-04-2004 12:48


All times are GMT -5. The time now is 14:11.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com