KMacattack
New Member
- Joined
- Nov 24, 2008
- Messages
- 11
I am trying to paste a couple cell from excel to word as an image and then insert text underneath the image. The only way that I have been able to get text underneath the image is to use a bunch of line breaks. Is there a way to find the point after the image, it seems like the cursor stays at the top of the page when inserting the image though.
Rich (BB code):
Sub CopyWorksheetsToWord<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
'This will copy the cell to word as a enhanced metafile.<o:p></o:p>
Application.ScreenUpdating = False<o:p></o:p>
Dim WdApp As Word.Application, wdDoc As Word.Document, ws As Worksheet<o:p></o:p>
<o:p></o:p>
'Creates a New Microsoft Word Document<o:p></o:p>
Application.StatusBar = "Creating new document..."<o:p></o:p>
Set WdApp = New Word.Application<o:p></o:p>
Set wdDoc = WdApp.Documents.Add<o:p></o:p>
<o:p></o:p>
'Copies The ranges and will paste into the crated microsoft word document<o:p></o:p>
Set ws = ActiveSheet<o:p></o:p>
Application.StatusBar = "Copying data from " & ws.Name & "..."<o:p></o:p>
ws.Range("B4:H27").Copy<o:p></o:p>
wdDoc.Paragraphs(wdDoc.Paragraphs.Count).Range.PasteSpecial DataType:=wdPasteEnhancedMetafile<o:p></o:p>
wdDoc.Paragraphs(wdDoc.Paragraphs.Count).Range.InsertParagraphAfter<o:p></o:p>
<o:p></o:p>
'Inserts Text into the Word Doc for the particular Points for discussion.<o:p></o:p>
wdDoc.Content.InsertAfter Chr(13) & Chr(13) & Chr(13) & Chr(13) & Chr(13) & Chr(13) & Chr(13)
wdDoc.Content.InsertAfter "My Text Here"
<o:p></o:p>
Set ws = Nothing<o:p></o:p>
Application.StatusBar = "Cleaning up..."
<o:p></o:p>
'Sets the Word Doc view to Print View and Zoom 85%<o:p></o:p>
WdApp.ActiveWindow.ActivePane.Zooms(wdPrintView).Percentage = 85<o:p></o:p>
WdApp.Visible = False<o:p></o:p>
<o:p></o:p>
Set wdDoc = Nothing<o:p></o:p>
Set WdApp = Nothing<o:p></o:p>
Application.StatusBar = False
Last edited: