Solved

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

Posted on 2014-07-28
6
234 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 50

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 50

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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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 11

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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