By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,667 Members | 2,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,667 IT Pros & Developers. It's quick & easy.

Using "Hyperlink" OR "OLE Object" Datatypes in VB/VBA

P: n/a
I have hundreds if not thousands of documents in various formats that I
have been asked to organize in such a way as to make it easy for the
people around here to search for them and to group them based on their
own criteria.. it seems like a pretty straightforward project.

I would like to embed links to the various objects in the database
manually I can do it with either OLE or Hyperlinks but there are too
many to do this manually, and I don't want to have to manually edit the
database every time an update is needed.

I can't find any reference to code that I can use to add or edit either
of these datatypes through vb/vba, can someone please point me in the
right direction?

Thanks

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
if you have some common naming protocol for your documents you can use
something similar to this.

If Me.Docname <> "" Then
stGMR = Me.Docname

Set fs = Application.FileSearch
With fs
..LookIn = "\\Pathtodocuments\"
..FileName = stGMR + ".doc"
If .Execute > 0 Then
Me!DocLnk.Visible = True
Me.LabelDocLnk.HyperlinkAddress = "\\Pathtodocuments\" + stGMR +
".doc"

End If

End With
fs = Null
Set fs = Application.FileSearch
With fs
..LookIn = "\\Pathtodocuments"
..FileName = stGMR + ".pdf"
If .Execute > 0 Then
Me!LabelDocLnk.Visible = True
Me.LabelDocLnk.HyperlinkAddress = "\\Pathtodocuments" + stGMR +
".pdf"

End If

End With
End If

Nov 13 '05 #2

P: n/a
Thanks, I'll give that a try..

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.