?
Solved

what is the vba command for "Paste Special Microsoft Visio Drawing Object" Using PowerPoint 2010

Posted on 2014-07-28
6
Medium Priority
?
259 Views
Last Modified: 2014-12-16
I am attempting to write a Macro in PowerPoint 2010 that allows me to Paste Special a selected Microsoft Visio Drawing Object.  I have been unable to find the VBA command that simulates this option available in the Paste Special.
0
Comment
Question by:dbfc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 52

Expert Comment

by:Rgonzo1971
ID: 40224467
Hi,

pls try

ActiveWindow.View.PasteSpecial DataType:=ppPasteOLEObject, Link:=msoFalse

Regards
0
 

Author Comment

by:dbfc
ID: 40227622
Already tried...does not provide the same result as  Paste Special "Microsoft Visio Drawing Object" available from the Paste Special options.
0
 
LVL 52

Expert Comment

by:Rgonzo1971
ID: 40228459
Pls try to record the same action in Excel

Then we will be able to adapt it to PPT

You should get something like this (I suppose)

ActiveSheet.PasteSpecial Format:="Microsoft Visio Document" _
        , Link:=False, DisplayAsIcon:=False

Regards
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Accepted Solution

by:
dbfc earned 0 total points
ID: 40236128
Thanks for your suggestion but I ended up finding the following solution that resolved my issue.

ActiveWindow.View.PasteSpecial ppPasteEnhancedMetafile, msoFalse
0
 
LVL 12

Expert Comment

by:Jamie Garroch
ID: 40469412
This might help too. EMF objects can be usefully converted to native Microsoft Drawing objects which can then be edited in PowerPoint (and other MSO apps).

' =====================================================================
' Macro written by Jamie Garroch of http://youpresent.biz
' =====================================================================
' Pastes a vector based object from the clipboard to the current slide,
' converts it to a native MS Drawing objetc and then ungroups it to
' individual shapes.
' =====================================================================
' Function Parameters
'
'   Convert = True will convert the pasted object to an MS Drawing
'             object and then ungroup it to its component shapes
' =====================================================================
' Function Return : the pasted ShapeRange
' =====================================================================

Option Explicit

Public Function PasteEMFtoSlideShapes(Optional Convert As Boolean) As ShapeRange
  On Error GoTo errorhandler
  Dim oShpRng As ShapeRange
  
  ' Paste the clipboard object as a vector in EMF format
  Set oShpRng = ActivePresentation.Slides(ActiveWindow.View.Slide.SlideIndex).Shapes.PasteSpecial(ppPasteEnhancedMetafile, msoFalse)
  If Convert Then
    With oShpRng(1)
      ' Ungroup to convert to Microsoft Drawing Object
      .Ungroup.Select
      ' Now ungroup a second time to get the component shapes
      ActiveWindow.Selection.ShapeRange.Ungroup
    End With
  End If
  
  Set PasteEMFtoSlideShapes = oShpRng
  
  ' Clean up
  Set oShpRng = Nothing
Exit Function

errorhandler:
  MsgBox "An error occured:" & vbCrLf & vbCrLf & Err & " : " & Err.Description, vbCritical + vbOK, "VBA Macro Error"
  Err.Clear
  Set oShpRng = Nothing
End Function

Open in new window

0
 

Author Closing Comment

by:dbfc
ID: 40502209
It was the easiest solution to implement.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question