PDA

View Full Version : Solved: Excel Pasting doesn't align to Word Bookmark



JimS
01-21-2009, 06:30 AM
I'm trying to use the code that is posted here at VBAExpress, the article location is /kb/getarticle.php?kb_id=133.

When Excel pastes a Chart into Word it does not paste the Chart at the Bookmark Location. It Pastes the Chart at the top of the Word page that has the Bookmark.

In example, if the Bookmark is located in the middle of Page 3 of the Word Doc the Chart will get pasted at the top of Page 3, not in the middle where the Bookmark is located.

Any ideas?

Thanks for any help...

Jim

PS: I'm wasn't sure if this should be posted in the Excel or Word Forum.

lucas
01-21-2009, 06:54 AM
You need to look at the page breaks in the word document I think. Next to view hit the button that looks like a revers P and see where the page breaks are located......that seems most likely to be your problem.

You can post an example if you hit post reply at the bottom left of the last post.....compose your message and scroll down and look for the button that says "manage attachments"

JimS
01-21-2009, 07:25 AM
I think I figured it out.

The Paste Code in Excel needs to be:

appWrd.Selection.PasteSpecial Link:=False, DataType:=wdPasteMetafilePicture, Placement:= _
wdInLine, DisplayAsIcon:=False

Thanks...

Kenneth Hobs
01-21-2009, 07:26 AM
You mean it does that with the kb example? It worked fine for me.

If it is your DOC, what happens when you do it manually? Copy the chart and then Ctrl+G to goto your bookmark in the DOC file and paste. The usual behavior is to put the image on the next page when there is not enough room on the current page at that location.

lucas
01-21-2009, 07:34 AM
ah, good catch. Guess Jake and I need to know more about Word. I know I only use if because I have to.......


Be sure to mark your thread solved using the thread tools at the top of the page.