H
hmmm...
Hi,
Enhanced metafile produces a picture that floats. In this post I call a
picture that does not float an "inline" picture.
Is there a way of selecting an inline picture from VBA? The picture
originates from Excel. It is copied/pasted using the following code.
Selection.GoTo what:=wdGoToBookmark, Name:="the_chart_bookmark"
exapp.Worksheets("Sheet1").ChartObjects(1).Chart.CopyPicture xlScreen,
xlPicture
Selection.Paste
I tried recording a macro, but in record mode, I could not select the
picture with the mouse. The only way I could select it in record mode was
to use arrow keys, and do a shift-arrow key back over the picture. However,
that recorded code is:
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
I want to directly reference the picture and select it. Similar to the way
it can be done for enhanced metafile.
I do not want to do a PasteSpecial specifying enhanced metafile because the
picture floats over the text (I want an inline picture). However, if I do a
PasteSpecial and specify enhanced metafile, then I can select with the mouse
during record mode, and I get the following code:
ActiveDocument.Shapes("Picture 11").Select
Is there anyway I can reference and select an inline picture in a similar
way?
Thanks.
Enhanced metafile produces a picture that floats. In this post I call a
picture that does not float an "inline" picture.
Is there a way of selecting an inline picture from VBA? The picture
originates from Excel. It is copied/pasted using the following code.
Selection.GoTo what:=wdGoToBookmark, Name:="the_chart_bookmark"
exapp.Worksheets("Sheet1").ChartObjects(1).Chart.CopyPicture xlScreen,
xlPicture
Selection.Paste
I tried recording a macro, but in record mode, I could not select the
picture with the mouse. The only way I could select it in record mode was
to use arrow keys, and do a shift-arrow key back over the picture. However,
that recorded code is:
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
I want to directly reference the picture and select it. Similar to the way
it can be done for enhanced metafile.
I do not want to do a PasteSpecial specifying enhanced metafile because the
picture floats over the text (I want an inline picture). However, if I do a
PasteSpecial and specify enhanced metafile, then I can select with the mouse
during record mode, and I get the following code:
ActiveDocument.Shapes("Picture 11").Select
Is there anyway I can reference and select an inline picture in a similar
way?
Thanks.