PC Review


Reply
Thread Tools Rate Thread

How to delete embedded Word object?

 
 
BlueBullDog
Guest
Posts: n/a
 
      2nd Jun 2010
I have an embedded Word document in an unbound object frame. I want to delete
the object from the object frame using VBA. How do I do it?

My goal is to let the user select Word documents and edit them in-place in
the unbound object frame, so I have to remove the existing object and replace
it with another. I've tried changing SourceDoc, but it does nothing. I've
tried setting the Action to acOLEDelete and that also does nothing.
 
Reply With Quote
 
 
 
 
Tom van Stiphout
Guest
Posts: n/a
 
      2nd Jun 2010
On Wed, 2 Jun 2010 06:53:01 -0700, BlueBullDog
<(E-Mail Removed)> wrote:

This worked for me and switched to the second doc:
OLEUnbound23.Action = acOLEDelete
OLEUnbound23.SourceDoc = "c:\test2.doc"
OLEUnbound23.Action = acOLECreateLink

Be sure your control is set to Enabled=True, Locked=False.

-Tom.
Microsoft Access MVP


>I have an embedded Word document in an unbound object frame. I want to delete
>the object from the object frame using VBA. How do I do it?
>
>My goal is to let the user select Word documents and edit them in-place in
>the unbound object frame, so I have to remove the existing object and replace
>it with another. I've tried changing SourceDoc, but it does nothing. I've
>tried setting the Action to acOLEDelete and that also does nothing.

 
Reply With Quote
 
BlueBullDog
Guest
Posts: n/a
 
      2nd Jun 2010
Tom,

Many thanks! I have looked several days for that simple solution. To get
the object to disappear, I used this:

Me.oleDoc.Action = acOLEDelete
Me.oleDoc.SourceDoc = ""
Me.oleDoc.Action = acOLECreateEmbed

Question: If I am adding and removing documents over and over again from
the unbound object frame, does the code above really remove the object from
the database so that the database does not incrementally inflate with each
new object that I bring in?

"Tom van Stiphout" wrote:

> On Wed, 2 Jun 2010 06:53:01 -0700, BlueBullDog
> <(E-Mail Removed)> wrote:
>
> This worked for me and switched to the second doc:
> OLEUnbound23.Action = acOLEDelete
> OLEUnbound23.SourceDoc = "c:\test2.doc"
> OLEUnbound23.Action = acOLECreateLink
>
> Be sure your control is set to Enabled=True, Locked=False.
>
> -Tom.
> Microsoft Access MVP
>
>
> >I have an embedded Word document in an unbound object frame. I want to delete
> >the object from the object frame using VBA. How do I do it?
> >
> >My goal is to let the user select Word documents and edit them in-place in
> >the unbound object frame, so I have to remove the existing object and replace
> >it with another. I've tried changing SourceDoc, but it does nothing. I've
> >tried setting the Action to acOLEDelete and that also does nothing.

> .
>

 
Reply With Quote
 
Tom van Stiphout
Guest
Posts: n/a
 
      3rd Jun 2010
On Wed, 2 Jun 2010 15:28:24 -0700, BlueBullDog
<(E-Mail Removed)> wrote:

I don't know but diskspace is cheap and the occasional Compact will
take care of bloat if it were to occur.

-Tom.
Microsoft Access MVP


>Tom,
>
>Many thanks! I have looked several days for that simple solution. To get
>the object to disappear, I used this:
>
> Me.oleDoc.Action = acOLEDelete
> Me.oleDoc.SourceDoc = ""
> Me.oleDoc.Action = acOLECreateEmbed
>
>Question: If I am adding and removing documents over and over again from
>the unbound object frame, does the code above really remove the object from
>the database so that the database does not incrementally inflate with each
>new object that I bring in?
>
>"Tom van Stiphout" wrote:
>
>> On Wed, 2 Jun 2010 06:53:01 -0700, BlueBullDog
>> <(E-Mail Removed)> wrote:
>>
>> This worked for me and switched to the second doc:
>> OLEUnbound23.Action = acOLEDelete
>> OLEUnbound23.SourceDoc = "c:\test2.doc"
>> OLEUnbound23.Action = acOLECreateLink
>>
>> Be sure your control is set to Enabled=True, Locked=False.
>>
>> -Tom.
>> Microsoft Access MVP
>>
>>
>> >I have an embedded Word document in an unbound object frame. I want to delete
>> >the object from the object frame using VBA. How do I do it?
>> >
>> >My goal is to let the user select Word documents and edit them in-place in
>> >the unbound object frame, so I have to remove the existing object and replace
>> >it with another. I've tried changing SourceDoc, but it does nothing. I've
>> >tried setting the Action to acOLEDelete and that also does nothing.

>> .
>>

 
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
Undo delete of embedded object xb Microsoft Excel Discussion 1 30th Jun 2009 11:06 AM
Word cannot open an embedded word document object when in read-onl Johan Eeckhout Microsoft Word Document Management 0 16th Jul 2008 01:04 PM
Embedded word object GS80 Microsoft Excel Programming 0 22nd Feb 2008 09:31 AM
Printing an embedded Word Object bluegrassstateworker Microsoft Excel Programming 0 4th May 2007 02:58 PM
How to delete embedded object Hall Microsoft Excel Discussion 1 16th Dec 2003 06:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:28 PM.