PC Review


Reply
Thread Tools Rate Thread

RE: Setting a object to ctlBoundObjectFrame.Object crashes access

 
 
Ralph
Guest
Posts: n/a
 
      9th Dec 2008
I dragged a Word document into the Report detail and it came in as an Unbound
Object Frame. I named it WordDoc then used:

dim wd as word.document
set wd=me.WordDoc.Object
With wd
'do something here
End With



"larryaxon" wrote:

> I have an Access report with a BoundObjectFrame that contains an MS word doc
> from a table that has a column type of OLE Object.
>
> It works fine until I try to get a Word.Application or Word.Document variable
> assigned to it so I can do some simple manipulation (just some token
> substitution).
>
> The code looks like this:
>
> Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
> Dim ctlOLE As BoundObjectFrame
> Dim myWordDoc As Word.Document
> Dim o As Object
> Set ctlOLE = WordDoc ' WordDoc is the name of the control
> Set o = ctlOLE.Object ' it crashes here
> ' Set myWordDoc = o.Documents(1) ' or something like this: I just
> want to do some Word stuff on the object
> End Sub
>
> Event though it looks to me like this conforms to the pattern in the code
> samples in MS Access help, when I set anything (including the Object variable)
> above, as well as a Variant, or whatever to the ctlOLE.Object, it crashes MS
> Access and wants to send a report to Microsoft.
>
> Yes, I have MS word in references.
>
> This is MS Access 2003.
>
> I also tried this with an Unbound frame with the same result.
>
> I assume I must be doing something stupid, but I can't find what it is.
>
> Anyone have experience with this?
>
> Thanks.
>
> --
> Larry Axon
> VP, TAG Backoffice
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy object or export object, can't open object laavista Microsoft Access 5 28th Jun 2009 04:50 AM
Outlook 2003 Crashes, and crashes, and crashes... rtart Microsoft Outlook Discussion 1 21st Aug 2008 08:35 PM
Programmatically detach object in unbound object frame to a bound object frame Haiyan Chen Microsoft Access Form Coding 0 4th Mar 2005 03:51 PM
Programmatically detach object in unbound object frame to a bound object frame Haiyan Chen Microsoft Access Form Coding 0 4th Mar 2005 03:47 PM
Setting a configurable time-out setting for all the communication initiated with Remoting object. Srinivasa Raghavan Sethuraman Microsoft ASP .NET 0 30th Jun 2004 11:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:08 PM.