Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2005

Tip: Looking for answers? Try searching our database.

Converting embedded Word Objects

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andy26 - 13 Sep 2005 13:27 GMT
I have a Word doc that contains a number of inline word doc objects.  I am
trying to scan through the doc and replace each of these OLEs with its actual
contents.  I can do this manually for one object but I can't figure out how
to do this programmatically.  I also need to check the object is a word doc
object as there may be some that are not.
Can anyone help?

Word Heretic - 13 Sep 2005 14:56 GMT
G'day andy26 <andy26@discussions.microsoft.com>,

You activeate it, which opens a new doc window, which you copy from,
and then paste back into the original. Each Shape has properties you
can use to determine if it is a word document (class id)

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice

andy26 reckoned:

>I have a Word doc that contains a number of inline word doc objects.  I am
>trying to scan through the doc and replace each of these OLEs with its actual
>contents.  I can do this manually for one object but I can't figure out how
>to do this programmatically.  I also need to check the object is a word doc
>object as there may be some that are not.
>Can anyone help?
andy26 - 13 Sep 2005 16:02 GMT
Thanks for the advice.  I'm a bit of a newbie at VBA.  I've got something
working now, but I would be grateful if you could see if this code makes
sense:

Sub Replace_word_OLEs()
Dim iShape As Word.InlineShape
For Each iShape In ActiveDocument.InlineShapes
   If Not iShape.OLEFormat Is Nothing Then
       If iShape.OLEFormat.ClassType Like "Word.*" Then
           iShape.Activate
           ActiveDocument.Range.Select
           Selection.Copy
           ActiveDocument.Close
           iShape.Delete
           Selection.PasteAndFormat (wdPasteDefault)
       End If
   End If
Next iShape

End Sub

> G'day andy26 <andy26@discussions.microsoft.com>,
>
[quoted text clipped - 15 lines]
> >object as there may be some that are not.
> >Can anyone help?
Word Heretic - 14 Sep 2005 03:03 GMT
G'day andy26 <andy26@discussions.microsoft.com>,

Looks good. You may have to select the ishape before deleting to make
sure the selection is now in the right place.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice

andy26 reckoned:

>Thanks for the advice.  I'm a bit of a newbie at VBA.  I've got something
>working now, but I would be grateful if you could see if this code makes
[quoted text clipped - 36 lines]
>> >object as there may be some that are not.
>> >Can anyone help?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.