-
Aug 6th, 2024, 04:44 AM
#1
Thread Starter
PowerPoster
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?
Last edited by xiaoyao; Aug 6th, 2024 at 04:49 AM.
-
Aug 6th, 2024, 04:45 AM
#2
Thread Starter
PowerPoster
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
-
Aug 6th, 2024, 06:12 AM
#3
Thread Starter
PowerPoster
-
Aug 6th, 2024, 06:27 AM
#4
Thread Starter
PowerPoster
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!
-
Aug 7th, 2024, 01:11 AM
#5
Thread Starter
PowerPoster
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|