Discussion:
Windows metafile versus enhanced metafile
(too old to reply)
Alex Trueman
2004-07-09 06:46:06 UTC
Permalink
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
DA
2004-07-12 01:56:02 UTC
Permalink
Hi Alex

(see comments below)

All the best,
Dennis
-----Original Message-----
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.
Thanks
Alex
.
Alex Trueman
2004-07-12 06:16:53 UTC
Permalink
Thanks Dennis, that worked perfectly.
Post by DA
Hi Alex
(see comments below)
All the best,
Dennis
-----Original Message-----
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
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.
Thanks
Alex
.
Loading...