A
AnneT
Hi,
Word2003. Tools.Options.Edit.PastePicturesAs - Inline with text.
I am trying to paste an image from the clipboard into a Word Document via
VBA. I have the setting set correctly under tools. It never pastes as
inline. After pasting, I always have to explicitly convert to inline shape.
Also, because it doesn't paste inline, if I am trying to set the image into
a table cell, the convert to inline shape sets the image in the correct row,
but always column 1, not column 2.
Any ideas of why I cannot paste inline? Two code snippets below. I am
running the code from Excel - trying to generate Word reports out of Excel,
hence the "wrdapp", "wrddoc", "wrdrange" references:
'Try to paste into row1, col2
wrdDoc.Tables(1).Cell(Row:=1, Column:=2).Range.Select
With wrdApp.Selection
.InsertAfter "hello" 'make sure selection is in the
right column
.PasteSpecial Placement:=wdInLine 'still doesn't work
End With
wrdDoc.Shapes(1).ConvertToInlineShape 'have to convert to inline, placed
r1c1
'try to paste into row2, col2
wrdDoc.Tables(1).Cell(Row:=2, Column:=2).Range.Select
wrdApp.Selection.PasteSpecial Placement:=wdInLine 'still doesn't
work
wrdDoc.Shapes(1).ConvertToInlineShape
'try to paste into 1st para
Set wrdrange = wrdDoc.Paragraphs.First.Range
With wrdDoc.Paragraphs(1).Range
.InsertAfter strEvent
.Paste 'doesn't paste inline even though
default set
End With
wrdDoc.Shapes(1).ConvertToInlineShape
The really strange part is even if i just open a new document, and select
paste, the image is not pasted inline.
What am I missing?
Thanks for your help
Word2003. Tools.Options.Edit.PastePicturesAs - Inline with text.
I am trying to paste an image from the clipboard into a Word Document via
VBA. I have the setting set correctly under tools. It never pastes as
inline. After pasting, I always have to explicitly convert to inline shape.
Also, because it doesn't paste inline, if I am trying to set the image into
a table cell, the convert to inline shape sets the image in the correct row,
but always column 1, not column 2.
Any ideas of why I cannot paste inline? Two code snippets below. I am
running the code from Excel - trying to generate Word reports out of Excel,
hence the "wrdapp", "wrddoc", "wrdrange" references:
'Try to paste into row1, col2
wrdDoc.Tables(1).Cell(Row:=1, Column:=2).Range.Select
With wrdApp.Selection
.InsertAfter "hello" 'make sure selection is in the
right column
.PasteSpecial Placement:=wdInLine 'still doesn't work
End With
wrdDoc.Shapes(1).ConvertToInlineShape 'have to convert to inline, placed
r1c1
'try to paste into row2, col2
wrdDoc.Tables(1).Cell(Row:=2, Column:=2).Range.Select
wrdApp.Selection.PasteSpecial Placement:=wdInLine 'still doesn't
work
wrdDoc.Shapes(1).ConvertToInlineShape
'try to paste into 1st para
Set wrdrange = wrdDoc.Paragraphs.First.Range
With wrdDoc.Paragraphs(1).Range
.InsertAfter strEvent
.Paste 'doesn't paste inline even though
default set
End With
wrdDoc.Shapes(1).ConvertToInlineShape
The really strange part is even if i just open a new document, and select
paste, the image is not pasted inline.
What am I missing?
Thanks for your help