File Format & Compatibility

Export a Selected PowerPoint Shape as WMF or EMF Using VBA in WPS Office

Amos GikundaAmos Gikunda Nov 13, 2026 869 views

Question details

The user wants to export the currently selected PowerPoint shape as a WMF or EMF picture using VBA, commonly to convert SVG graphics into editable vector formats.

Export a Selected PowerPoint Shape as WMF or EMF Using VBA in WPS Office
Product
WPS Presentation
Device & OS
not provided
Scenario
The user has an SVG converted into an editable shape in a presentation and needs to output that shape as a vector image file programmatically.
Observed behavior
The selected shape should be saved as a .wmf or .emf file at a specified path while retaining vector quality.
Before you start

Open the presentation in WPS Presentation, select the target shape on the slide, and make sure the destination folder exists and is writable. If you plan to run VBA macros, enable macros or use a macro-enabled presentation format.

Solution 1Recommended

Export the Selected Shape with ShapeRange.Export and ppShapeFormatWMF

Use this when you need a standard WMF copy of the currently selected shape from VBA.

The ShapeRange.Export method exports the first shape in the current selection to the specified picture format. The available format constants include ppShapeFormatWMF and ppShapeFormatEMF.

1
Open the VBA editor

In WPS Presentation, press Alt+F11 to open the Microsoft Visual Basic for Applications editor.

2
Insert a module

In the VBA editor, click Insert > Module to create a new code module.

3
Paste the export macro

Paste the following code into the module: Sub ExportAsWMF() ActiveWindow.Selection.ShapeRange(1).Export "C:\filename.wmf", ppShapeFormatWMF End Sub

4
Run the macro

Click Run > Run Sub/UserForm or press F5 while the cursor is inside the macro, then check the exported file at C:\filename.wmf.

Export the Selected Shape with ShapeRange.Export and ppShapeFormatWMF
Shape exported: The selected shape is saved as a WMF file at the specified path.
Direct solution with WPS Presentation

Export Selected Shapes as WMF or EMF Using VBA in WPS Presentation

Use WPS Presentation's VBA editor to run a ShapeRange.Export macro that saves the selected shape as a WMF or EMF vector image, with a familiar PowerPoint-compatible workflow.

  1. 1. Download and open WPS Office: Download WPS Office from the official site, install it, and open your presentation in WPS Presentation.
  2. 2. Select the target shape: Click the shape you want to export on the slide so it becomes the active selection.
  3. 3. Open the VBA editor: Press Alt+F11 to open the VBA editor, then click Insert > Module.
  4. 4. Paste and run the export macro: Paste the ShapeRange.Export code with ppShapeFormatWMF or ppShapeFormatEMF, then press F5 to run it.
  5. 5. Verify the exported file: Go to the path in the code and open the .wmf or .emf file to confirm the shape exported correctly.
Exports selected shapes as WMF or EMF with VBA codeSupports .pptx and other Microsoft PowerPoint-compatible formatsFree, lightweight Office suite with a familiar ribbon interfacePreserves vector quality for SVG-converted shapes
microsoft office alternative - wps office

Frequently Asked Questions

Can I export a selected PowerPoint shape as EMF instead of WMF?

Yes. Use ActiveWindow.Selection.ShapeRange(1).Export "C:\filename.emf", ppShapeFormatEMF. EMF is often better for complex SVG-converted shapes.

Why is my exported WMF incomplete or distorted?

WMF has limited support for complex vector graphics. Change the export format from ppShapeFormatWMF to ppShapeFormatEMF to preserve more detail.

Does WPS Presentation support VBA macros for exporting shapes?

Yes. WPS Presentation includes a VBA editor where you can insert a module and run ShapeRange.Export macros, similar to PowerPoint.

How do I convert an SVG into an editable shape before exporting?

In WPS Presentation or PowerPoint, insert the SVG, convert it to editable shapes as needed, select the resulting shape, and then run the VBA export macro.

Where is the exported WMF or EMF file saved?

The file is saved to the path specified in the Export method, such as C:\filename.wmf. Make sure the destination folder exists and is writable.