SydneyGeek
10-22-2008, 05:21 PM
Hi,
I haven't had a lot to do with Word VBA and I am banging my head against a wall on this one.
I am trying to paste an Excel table as a metafile in a Word document. I tried all the options with the recorder, and found that I got the following:
'paste as an enhanced metafile
Selection.PasteAndFormat (wdPasteDefault)
'paste as an Excel object
Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, Placement _
:=wdInLine, DisplayAsIcon:=False
'paste as a Word table, formatted like the Excel original
Selection.PasteExcelTable False, False, False
So far, so good. I want to use the metafile option so I inserted the relevant code and ran the routine -- result was not a picture, but a Word table which causes issues because the size is different and it wrecks the document layout.
I went for a dig and the wdPasteDefault enumerator is listed as 'not supported' in the 2007 Developer Help. This, despite the fact that recording the macro gave me exactly what I wanted.
Can anyone point me in the right drection please?
Denis
I haven't had a lot to do with Word VBA and I am banging my head against a wall on this one.
I am trying to paste an Excel table as a metafile in a Word document. I tried all the options with the recorder, and found that I got the following:
'paste as an enhanced metafile
Selection.PasteAndFormat (wdPasteDefault)
'paste as an Excel object
Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, Placement _
:=wdInLine, DisplayAsIcon:=False
'paste as a Word table, formatted like the Excel original
Selection.PasteExcelTable False, False, False
So far, so good. I want to use the metafile option so I inserted the relevant code and ran the routine -- result was not a picture, but a Word table which causes issues because the size is different and it wrecks the document layout.
I went for a dig and the wdPasteDefault enumerator is listed as 'not supported' in the 2007 Developer Help. This, despite the fact that recording the macro gave me exactly what I wanted.
Can anyone point me in the right drection please?
Denis