473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Coding to Open myBrowser and insert a Hyperlink

AllusiveKitten
Hi

I was wondering if it was possible to code in a command to open the browser which will select a file that I want to insert as a hyperlink using a form.

I hope this does not sound too confusing.

Thank you
AK
Oct 10 '07 #1
3 1883
MMcCarthy
14,534 Expert Mod 8TB
Firstly you will have to make sure there is a reference ticked to the Microsoft Office library and I think this only works properly in Office XP (2002) and above.

Now add the following code to your command button. You don't specify the type of file so I'm going with Excel.

Expand|Select|Wrap|Line Numbers
  1. Dim dlgPickFiles As FileDialog
  2. Dim strFilePath As String
  3.  
  4.     Set dlgPickFiles = Application.FileDialog(msoFileDialogFilePicker)
  5.  
  6.     With dlgPickFiles
  7.         .AllowMultiSelect = False
  8.         .Filters.Clear
  9.         .Filters.Add "Excel files", "*.xls"
  10.     End With
  11.  
  12.     If dlgPickFiles.Show Then
  13.         strFilePath = dlgPickFiles.SelectedItems.Item(1)
  14.     End If
  15.  
  16.     Set dlgPickFiles = Nothing
  17.     Me.txtHyperlink = strFilePath ' I don't know the name of the textbox
  18.  
  19. End Sub
  20.  
Oct 11 '07 #2
Thank you so much mmccarty,

You have saved me from going nuts, I cannot thank you enough.

Cheers

AK
Oct 11 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Thank you so much mmccarty,

You have saved me from going nuts, I cannot thank you enough.

Cheers

AK
You're welcome.
Oct 11 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

40
by: Brian Jorgenson | last post by:
On my web page, I have a few hyperlinks with target frame of _blank. The hyperlink brings up a second window, but everytime I click on thie hperlink, it keeps bringing up a new window and not...
0
by: Bill Thom | last post by:
I have a Microsoft Access 2000 (9.0.4402 SR-1) database that I am attempting to launch from a hyperlink using Internet Explorer (Version 6.0.2800.1106). If I attempt to launch the database from...
5
by: John Warner | last post by:
I have a wierd problem that I can't find any reference to in the knowledge base. I develop simple databases at the company where I work, and many of them are used by hundreds of employees. We all...
3
by: hb | last post by:
Hi, I have a asp:button btnGo. When clicking this button, the code will parse a asp:table to find a specific ID under certain conditions. Once the ID is found, the code need to keep the current...
9
by: dana lees | last post by:
Hello, I am using asp:HyperLink in a c# asp.net application to open a new window in the following way: <asp:HyperLink ID="lnkSiteName" runat="server" Text='<%# DataBinder.Eval(Container,...
9
by: loga123 | last post by:
I am using asp .net 2.0. I have a hyperlink asp control on my web page page1.aspx. On clicking this hyper;link, I would like to open page2.aspx (which is in the same web application) in a new IE...
9
by: smokeyd | last post by:
hi, can anyone tell me how to open a link in a new browser window in vbscript.net. i am looking to be able to set the properties such as size, menu bar, scroll bar etc. or alternativelly is...
2
by: adamace5o | last post by:
When i try to use post variables with php and mysql i can't get the insert into statement to accept varibles as values. If i use 'test' instead of $test it does work. I suspect it is something to do...
16
by: GLEberts | last post by:
Subject: Trying to open up a record in a form called "fmappointment" when clicking on a "looks like hyperlink" text box called "ContactID" I have made many instances of this in my database but in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.