Accessing OLE object programatically

byteminister

New member
Local time
Today, 22:00
Joined
Aug 5, 2008
Messages
3
Hello dear friends,

I am a complete beginner at access and VBA programming.
I am banging my head over a thing that is probably very easy to even an average access vba programmer, the thing is I don't know how to get a reference(in a module) to an OLE object( let's say a pdf file) that was inputed in a Bound object frame via right click & insert object.

I need to get the reference of that object to put it into a method that returns the url (file path) of the object, that is all. Please help.

Thank you very much!

p.s.
I am a ruby and java programmer but Im completly new to VBA and all that win32 ,ado and other apis and I have no time to learn this stuff.
 
Sorry, I don't have time to do it for you.
 
All I am asking here is which property of Bound object frame do I use to get the OLE object which I can store as Variant so I can use the following function:

Code:
Function GetLinkedPath(objOLE As Variant) As Variant
          Dim strChunk As String
          Dim pathStart As Long
          Dim pathEnd As Long
          Dim path As String
          If Not IsNull(objOLE) Then
             ' Convert string to Unicode.
             strChunk = StrConv(objOLE, vbUnicode)
             pathStart = InStr(1, strChunk, ":\", 1) - 1

             ' If mapped drive path not found, try UNC path.
             If pathStart <= 0 Then pathStart = _
                              InStr(1, strChunk, "\\", 1)

             ' If either drive letter path or UNC path found, determine
             ' the length of the path by searching for the first null
             ' character Chr(0) after the path was found.
             If pathStart > 0 Then
                pathEnd = InStr(pathStart, strChunk, Chr(0), 1)
                path = Mid(strChunk, pathStart, pathEnd - pathStart)
                GetLinkedPath = path
                Exit Function
             End If
          Else
             GetLinkedPath = Null
          End If
       End Function

georged, I guess you have time being rude, or maybe you just don't know VBA.
 
Hi
I'm trying to get linked path from ole object in Access 2007 and i get only ":" as path.
Could it be because i'm using access 2007?
Do you know any way to obtain the files paths?
Regards
 
I also started learning VBA and facing this reference issue. Please someone help me if he/she has an easy and simple solution.
 
A link path to an OLE object??? No such thing.
 

Users who are viewing this thread

Back
Top Bottom