Excel-->Word Copy/Paste Range @ Bookmark

M

me

Good Afternoon. I desperately need help doing a simple thing. I am
trying to use a copied USEDRANGE from Excel and paste it into a BOOKMARK
in Word. Sounds simple, but I can not get it done so far. My code just
sticks the copied range at the top of the word document. I need to
pinpoint it to copy at the InitialAssessment Bookmark. Here's the code:

Code:
Public Sub SendToWord()
Public Sub SendToWord()
Dim CAP As Range
Dim myWord As Word.Application
Dim bkmk As Word.Bookmark
Set CAP = Sheets("InitialAssessments").UsedRange
CAP.Copy
Set myWord = New Word.Application
With myWord
.Visible = True
.Activate
myWord.Documents.Open _
Filename:="C:\Documents and Settings\chrisv\Desktop\HBC2\Report
Document\HBC Reporting Document.doc"
With .Selection
Set bkmk = myWord.ActiveDocument.Bookmarks("InitialAssessments")
.Select
.TypeParagraph
.PasteAsNestedTable Link:=False, DataType:=wdPasteOLEObject
End With
End With
End Sub


Suggestions??? Please advise
 
D

Doug Robbins - Word MVP

Try:

Public Sub SendToWord()
Dim CAP As Range
Dim myWord As Word.Application
Dim myDoc as Document
Dim bkmk As Word.Bookmark
Set CAP = Sheets("InitialAssessments").UsedRange
CAP.Copy
Set myWord = New Word.Application
Set myDoc = myWord.Documents.Open _
(Filename:="C:\Documents and Settings\chrisv\Desktop\HBC2\Report
Document\HBC Reporting Document.doc")
myDoc.Bookmarks("InitialAssessments").Range.PasteAsNestedTable Link:=False,
_ DataType:=wdPasteOLEObject
myDoc.Activate
End Sub


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
W

Word Heretic

G'day me <spam@spam>,

Change
Set bkmk = myWord.ActiveDocument.Bookmarks("InitialAssessments")
.Select

to this

myWord.ActiveDocument.Bookmarks("InitialAssessments").Select


Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


me reckoned:
 
C

Chris Villanueva

Heretic,

Just wanted to thank you for the response. It worked
like a charm.

Chris
 

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