Importing Word Objects, without retaining Object status

M

Mark Parent

I'm creating a Word document from an Excel document, and depending on various
selections made in the Excel document, I include particular segments of text.

I have created the individual segments in Word, and copied/pasted them into
my Excel document as Word Objects. This works great, because the segments
keep all the Word formatting, and I can copy/paste specific Word Objects into
a new Word document. The problem is that I'd prefer not to have each segment
as a separate Word Object within the new Word document. I can't find a paste
special or other method to return the Word Objects into "native" (my
terminology) Word. Any ideas?
 
R

Russ

If these objects are fields, you can change them into plain text with
myobject.unlink.
 
M

Mark Parent

In case anyone else finds this post, and wonders how to handle it, I've found
one method that does the trick. After copying and pasting the word segment
into a new Word document, I open the object in a separate sessions, select
all the text, copy it to the clipboard then close the edit session. Back in
the new WORD document, I delete object, and paste in the text from the
clipboard.

Here is the code that is working for me just fine.
Thanks to Russ for his suggestion.


ThisWorkbook.Sheets("Texts").OLEObjects("Segment 1").Copy
appWD.Selection.Paste

appWD.Selection.ShapeRange(1).OLEFormat.DoVerb _

VerbIndex:=wdOLEVerbPrimary
appWD.Selection.WholeStory
appWD.Selection.Copy
appWD.ActiveWindow.Close

appWD.Selection.Delete
appWD.Selection.PasteAndFormat (wdPasteDefault)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top