I am trying to write a function which will activate a word document in an unbound object frame when the report is opened. This is my function now.
Private Sub Report_Open(Cancel As Integer)
Dim UnboundOLE As ObjectFrame
On Error GoTo Err_Report_Open
Set UnboundOLE = Me.Controls("oleDocument"
UnboundOLE.Action = acOLEActivate
UnboundOLE.SetFocus
Exit_Report_Open:
Exit Sub
Err_Report_Open:
MsgBox Err.Description
Resume Exit_Report_Open
End Sub
When I run this I get "Run-time error '2771': The bound or unbound object frame you tried to edit doesn't contain an OLE object". In searching the threads i have seen this error referred to several times, but no explanations or solutions.
Private Sub Report_Open(Cancel As Integer)
Dim UnboundOLE As ObjectFrame
On Error GoTo Err_Report_Open
Set UnboundOLE = Me.Controls("oleDocument"
UnboundOLE.Action = acOLEActivate
UnboundOLE.SetFocus
Exit_Report_Open:
Exit Sub
Err_Report_Open:
MsgBox Err.Description
Resume Exit_Report_Open
End Sub
When I run this I get "Run-time error '2771': The bound or unbound object frame you tried to edit doesn't contain an OLE object". In searching the threads i have seen this error referred to several times, but no explanations or solutions.