OLE Unbound Object Frame - Changing the linked source

boblarson

Smeghead
Local time
Today, 06:42
Joined
Jan 12, 2001
Messages
32,059
Well, I have a problem. I don't know what to do about this.

We have a report which has an embedded Word Document (but linked) in order to have a map come up on the report which shows, in color, the number of states that have a certain number of properties.

So, this has been working fine for years. But now we are having to become part of the larger corporate structure and we have to have these different environments. Before it was just our same structure here in Portland. So, we could link to the map and all was fine either when testing or in live production. But now we have a special release process where we develop on our Dev Environment (all Citrix based with the servers in Kansas City) and then move things over to our Test Environment which is still on Citrix and based in Kansas City. After the release is tested there it moves on to the QA environment in Cleveland. And after that - production, also in Cleveland (also QA and Prod - also on Citrix).

So, unfortunately, the embedding of this map actually stores the UNC path (even if you choose it through a drive mapping). So, when we move everything between environments we need to physically delete the map and then re-embed it using the linked document on the particular server at the time. I've looked into coding for this and, while the help file says it can be done, when I try to do it, it gives me an error message of something along the lines of "method or property not supported for this object." So, I'm not sure what to do. Has anybody done anything around this type of thing before? Even when our Portland servers broke down and we had new servers, I had to manually delete and add back the map in the report because just going to the link and changing it didn't work.

:confused::confused:
 
Bob,

I know this is not a word document but I have had to do something similar with linked images using an ActiveX, Unbound Picture and a Linked image on the form, the later is the only time I have ever used a static physical file reference. The one GetImage function operates for forms and reports.

A small file exists for each use FE with the directory locations. I store the Image Directory on the Menu and concatenate the Image file from the Form or Report thus:

Code:
Function GetImageDir() As String

    GetImageDir = Forms![Menu]![Image Directory]

End Function
then

Code:
Function GetPicture()

Dim FullPath As String

    With CodeContextObject
        FullPath = GetImageDir & .[Image File]

        If Dir([FullPath]) <> Empty Then
            .[ImageControl].Visible = True
            .[ImageControl].Picture = FullPath
        Else
            .[ImageControl].Visible = False
        End If
    End With

End Function
This even worked only part of the function included:
Code:
        If .[Orig Stock Status] = "P" Then
            .Picture = "C:\Databases\Livery\Background_OriginalsStatusPurch.jpg"
        ElseIf .[Orig Stock Status] = "H" Then
            .Picture = "C:\Databases\Livery\Background_OriginalsStatusHistory.jpg"
        Else
            .Picture = "C:\Databases\Livery\Background_Originals.jpg"
        End If
    End With
Simon
 

Users who are viewing this thread

Back
Top Bottom