Windows metafile versus enhanced metafile

A

Alex Trueman

I have two questions regarding the PasteSpecial method:

1.) I would like to paste the contents of the clipboard as a "Picture (Windows
Metafile)" to the active cell of a table in Word using VB. The code below is
straight out of the VB help examples. It works if the selection is not inside a
table but if the selection is inside a table it does not work. If I record the
actions of paste special to a cell the code generated uses PasteAndFormat, but
this does not allow me to specify "Picture (Windows Metafile)". What is the
solution?

Selection.Collapse Direction:=wdCollapseStart
Selection.Range.PasteSpecial datatype:=wdPasteMetafilePicture

2.) To reduce Word document file size I have always pasted graphics (charts,
etc.) as "Picture (Windows Metafile)" rather than "Picture (Enhanced Metafile)"
believing that the former is smaller in size than the latter. Is this true?

Thanks
Alex
 
D

DA

Hi Alex

(see comments below)

All the best,
Dennis
-----Original Message-----
I have two questions regarding the PasteSpecial method:

1.) I would like to paste the contents of the clipboard as a "Picture (Windows
Metafile)" to the active cell of a table in Word using VB. The code below is
straight out of the VB help examples. It works if the selection is not inside a
table but if the selection is inside a table it does not work. If I record the
actions of paste special to a cell the code generated uses PasteAndFormat, but
this does not allow me to specify "Picture (Windows Metafile)". What is the
solution?

Selection.Collapse Direction:=wdCollapseStart
Selection.Range.PasteSpecial datatype:=wdPasteMetafilePicture

If you try something like this, you should get your paste
to work:

Selection.Copy
ActiveDocument.Tables(1).Cell(1, 1).Range.PasteSpecial _
DataType:=wdPasteMetafilePicture

2.) To reduce Word document file size I have always pasted graphics (charts,
etc.) as "Picture (Windows Metafile)" rather
than "Picture (Enhanced Metafile)"
believing that the former is smaller in size than the
latter. Is this true?

Basically true, the Enhanced Metafile format is a 32-bit
superset of the 16-bit Windows Metafile.
 
A

Alex Trueman

Thanks Dennis, that worked perfectly.
Hi Alex

(see comments below)

All the best,
Dennis



as a "Picture (Windows


VB. The code below is


selection is not inside a


work. If I record the


uses PasteAndFormat, but


Metafile)". What is the


datatype:=wdPasteMetafilePicture


If you try something like this, you should get your paste
to work:

Selection.Copy
ActiveDocument.Tables(1).Cell(1, 1).Range.PasteSpecial _
DataType:=wdPasteMetafilePicture




pasted graphics (charts,


than "Picture (Enhanced Metafile)"


latter. Is this true?

Basically true, the Enhanced Metafile format is a 32-bit
superset of the 16-bit Windows Metafile.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top