VBA Word: Pasting as Metafile Picture Format

Susanto3311
3StarLounger
Posts: 240
Joined: 17 Feb 2022, 05:16

VBA Word: Pasting as Metafile Picture Format

Post by Susanto3311 »

hi all.

by default Paste Special, in Ms Word since pasting picture/graphic, there is no choice in paste as Metafile Picture format.
question:
1. how to show Metafile Picture format in MS word if this possible or
2. how to make vba macro code as ms word add-in that can pasting in Metafile Picture format.
for reason, i need this format cause Metafile Picture format that compatible with my internal application for handling picture/graphic
anyone help, thank in advance
susant
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: VBA Word: Pasting as Metafile Picture Format

Post by HansV »

Picture (Enhanced Metafile) is only available in the Paste Special dialog in Word if the contents of the clipboard are suitable for this type, for example if you copied a cell range or a chart in Excel, but not if you took a screenshot.
In VBA, you can use

Selection.PasteSpecial DataType:=wdPasteMetafilePicture

but again, this will only work if the clipboard contains a suitable object. Otherwise, you'll get an error message.
Best wishes,
Hans

Susanto3311
3StarLounger
Posts: 240
Joined: 17 Feb 2022, 05:16

Re: VBA Word: Pasting as Metafile Picture Format

Post by Susanto3311 »

hi hans...
thank you very much.