Windows metafile versus enhanced metafile

MS WORD

    Next

  • 1. Protect Form code
    Hi, How do you make the following code Protect only? This code will protect an unprotected form AND unprotect a protected form. I just need it to Protect. Sub ProtectForm() If ActiveDocument.ProtectionType = wdNoProtection Then ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _ NoReset:=True Else ActiveDocument.Unprotect Password:="" End If End Sub
  • 2. FormField
    I have linked text to a FormField on my document and it changes when I manually change the selected item of the FormField. However, when I change the item in a Macro like so it doesn't change the linked text to match: ActiveDocument.FormFields("PortfolioAnalyst").Result = PersonSelected Has anybody ever dealt with this before? Thanks!
  • 3. Import value from an Excel cell into a Word document
    Hi, I am fairly new to word vba and would like to import some a cell from Excel into a Word document. For example, I would like to import a cell from an excel file (say C:\ \LinkToWord.xls Sheet!1 cell B7, which holds the value 3.55). Then in Word, I would like to insert the value from excel into a sentence, like : My cat is //Insert cell B7// years old. Any ideas how to do this ? Regards, Tom
  • 4. Help writing a picture formatting macro
    Hello, I was wondering if you guys could help me. I am trying to write a macro to format a picture I have pasted into a word document. Unfortunately the wrap to text and advanced functions of the format picture tab are not available when writing a macro. I have seen someone here had the same problem and the following code was posted: With myShape .WrapFormat.Type = wdWrapTopBottom .WrapFormat.DistanceTop = InchesToPoints(0.2) .WrapFormat.DistanceBottom = InchesToPoints(0.2) .RelativeHorizontalPosition = wdRelativeHorizontalPositionPage .Left = wdShapeCenter The thing is my requirements are different to this and now matter how I change the code above I can't get it to work. Can anyone help please? I need the options Wrap type = Square Horizontal Alignment = Other and in the advanced options Absolute position 4.23 from the right of the page Absolute position 0.00 below paragraph. I know this is quite complicated and a big ask - but if anyone can help it would be amazing as i have to format pictures according to this layout about 20 times a day as part of my job and a macro would totally help me out. Thanks, Sotiris
  • 5. how do I add scripts to my word doc?
    I would like to add jscript to my Word document. Is this possible?

Windows metafile versus enhanced metafile

Postby Alex Trueman » Sat, 10 Jul 2004 15:46:06 GMT

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


Windows metafile versus enhanced metafile

Postby DA » Tue, 13 Jul 2004 10:56:02 GMT

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. 


Re: Windows metafile versus enhanced metafile

Postby Alex Trueman » Tue, 13 Jul 2004 15:16:53 GMT

Thanks Dennis, that worked perfectly.




Similar Threads:

1.Paste Special: Metafile vs Enhanced Metafile

What's the difference between Picture (Windows Metafile) and Picture 
(Enhanced Metafile) in the Paste Special options? Is there a good rule as to 
when to use one over the other?

At a quick look for pasting Excel sheets, they seem the same, but I'd guess 
that's just because Excel sheets don't have any fancy graphics, gradients, 
etc. But that's just my guess. Perhaps Windows Metafile is fine for basic 
shapes and Enhanced Metafile is better for advanced vector images?

Thanks,
Colin 


2.windows and enhanced metafile

 Hello all. I am pasting from Excel into Word 2003, using the paste special 
option. I am curious as to the differences between a windows metafile and an 
enhanced metafile. I see no real visible difference in the picture itself, 
which is mostly composed of text and cell borders, and I am curious if the 
size of the file when it is saved plays a part. So, does anyone know if there 
are major differences or benefits to using one format over the other? Thanks 
in advance.


3.Rotating Enhanced Metafile

Hi have the handle of an EnhMetafile and would like to draw it onto another 
EnhMetafile DC with simple 90, 180, 270 degree rotations.
I've been able to do it using SetWorldTransform but unfortunately it isn't 
supported by Win 9x/ME.
Is there any other way of doing it?

Thanks,
Andy. 


4.Enhanced Metafiles

Dear Experts,

I'm trying to get the description record of an EMF file, is there any way to
do it in VB.NET?

TIA.

Marc


5.PasteSpecial & enhanced metafile not working

Hi,

I am trying to copy an object from Visio and paste it to Word using
Visual Basic scripting. I want the copied object to be pasted as an
enhanched metafile. No matter what I use as a destination data type,
the object ends up be pasted as an embedded Visio object.

Manual pasting works fine.

Is there a workaround for this?

My code:


Sub DoCopyPaste()

    ' Get Running Microsoft Word
    Set wordApp = GetObject(, "Word.Application")

    ' Get Running Microsoft Visio
    Set visioApp = GetObject(, "Visio.Application")

    If wordApp = Nothing Then
        Debug.Print "No Microsoft Word open"
        Return
    End If

    ' Copy selected object in Visio
    visioApp.ActiveWindow.Selection.Copy

    ' Paste object in Word
    wordApp.Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafile, _
        Placement:=wdFloatOverText, DisplayAsIcon:=False

6. Macro for Paste Special - Picture (Enhanced Metafile)

7. Pasting from xl into word as an enhanced metafile

8. Microsoft Office 2003 and 2007 crashes when managing EMF (enhanced metafiles)



Return to MS WORD

 

Who is online

Users browsing this forum: No registered users and 0 guest