OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

How Can I create a hyperlink on subform ?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
oxigen74
Newbie
Newbie


Joined: 02 Feb 2004
Posts: 1

PostPosted: Mon Feb 02, 2004 5:32 am    Post subject: How Can I create a hyperlink on subform ? Reply with quote

Dear All,

I link a form with a subform. All is Ok. Now I have one colum where the data are hyperlink (http:\\..etc..). How can I find the way to select the hyperlnk and go directly to web page?


Best Regrds
Oxigen74
Back to top
View user's profile Send private message
dfrench
Moderator
Moderator


Joined: 03 Mar 2003
Posts: 1605
Location: Wellington, New Zealand

PostPosted: Mon Feb 02, 2004 6:11 pm    Post subject: Reply with quote

One method>>>
1. Put a button control on the subform, set type to url.
2. Create a macro that gets the url from the control that is displaying it and puts it in the targeturl property of the pushbutton
3. Assign the macro to the 'mouse inside' event of the pushbutton


Example of the macro code where the form has a listbox with the urls to be selected. Note that the urls must be valid like "http://www.ibm.com/us/" not just www.etc
Code:
Sub Main
odoc=thiscomponent
oForm=odoc.drawpage.forms.getbyname("Standard")
oCtl=oForm.getbyname("PushButton")  'pushbutton control is of type URL
osourcectl=oForm.getbyname("ListBox")  'listbox contains list of urls
' set the targeturl property of url pushbutton to the first selected item in the listbox
oCtl.TargetURL = osourcectl.stringitemlist(osourcectl.selecteditems(0) )
End Sub
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group