Results 1 to 5 of 5

Thread: how to export word graphic element to EMF vector diagram format,svg?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,180

    how to export word graphic element to EMF vector diagram format,svg?

    The graphic element component of WORD is converted into EMF vector diagram format.
    There are blanks around the imported picture. How can I export without blanks?
    Attached Images Attached Images     
    Last edited by xiaoyao; Aug 6th, 2024 at 04:49 AM.

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,180

    Re: how to export word graphic element to EMF vector diagram format,svg?

    How to export the graphic element components of WORD and convert them into EMF vector diagram format?

    Images exported with WORD VBA are equivalent to their positions in WORD documents by default.
    If a single graphic element is displayed in the upper left corner of an empty WORD, two pixels may be missing on the left side when exporting, and the width is 3600 pixels the same as my screen.
    I wonder if there is any way to export these elements into EMF vector diagram format, such as PPT,EXCEL or third-party software?

    I want to find a software that can generate simple vector graphic elements, export EMF format pictures, and then zoom in and out at will in VB6 without blurring.

    Code:
    Sub exportEMF()
    
    Dim i As Long
        Const adTypeBinary = 1
        '?????????
        Const adTypeText = 2
        Const adSaveCreateNotExist = 1
        Const adSaveCreateOverWrite = 2
        Dim oStream As Object
        Dim arr() As Byte
        Set oStream = VBA.CreateObject("adodb.stream")
        i = 1
        Dim oDoc As Document
        Set oDoc = Word.ActiveDocument
        Dim oSP As Shape
        Dim sPath As String
        sPath = oDoc.Path & "\"
     
        
        Dim oInLineSp As InlineShape
        With oDoc
            For Each oSP In .Shapes
                 
                oSP.Select
                MsgBox oSP.Type
                arr = Word.Selection.EnhMetaFileBits
                With oStream
                    .Open
                    .Type = adTypeBinary
                    .Write arr
                    .SaveToFile sPath & i & ".emf", adSaveCreateOverWrite
                    .Close
                End With
                'MsgBox "i:" & i
                i = i + 1
            Next
            For Each oInLineSp In .InlineShapes
                arr = oInLineSp.Range.EnhMetaFileBits
                With oStream
                    .Open
                    .Type = adTypeBinary
                    .Write arr
                    .SaveToFile sPath & "b" & i & ".emf", adSaveCreateOverWrite
                    .Close
                End With
                i = i + 1
            Next
        End With
        MsgBox "ok"
    End Sub

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,180

    Re: how to export word graphic element to EMF vector diagram format,svg?

    Word graphic elements, export PNG picture 200*200 pixels 145kb, emf vector format is only 3.5KB.
    Attached Images Attached Images  
    Attached Files Attached Files

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,180

    Re: how to export word graphic element to EMF vector diagram format,svg?

    Can you export with pure exe? Without the help of third-party software such as word!
    For example, I input a number with a radius of 50 and the color is red, and then I export emf. After opening it, it is a circle with a radius of 50 mm in emf format!

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,180

    Re: how to export word graphic element to EMF vector diagram format,svg?

    .net chart control save as emf format
    Square EMF graphic elements, the width of each side has changed after stretching.
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by xiaoyao; Aug 7th, 2024 at 01:15 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width