Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2012, 12:57 PM
excelledsoftware excelledsoftware is offline Convert To Freeform Windows 7 64bit Convert To Freeform Office 2003
IT Specialist
Convert To Freeform
 
Join Date: Jan 2012
Location: Utah
Posts: 453
excelledsoftware will become famous soon enough
Default Convert To Freeform

There are such great answers on this forum. I have a macro (pasted below) that I use to take an autoshape and convert it to points. I know that sendkeys is not ideal to use but since PasteSpecial is not possible to record this is what I use.
The macro will cut the shape then paste special it as an enhanced metafile.
Then the macro will ungroup the metafile a prompt will come asking to convert it to a msoffice drawing object which the macro will say yes to, then the macro ungroups it again and then deletes the other 2 shapes from the conversion.
Any suggestions on how to accomplish the same thing without using sendkeys. The last 2 shapes deletion is not that important its just nice to not have to delete the fill and then the blank square each time.

Sub CTP()
SendKeys "^{x}", wait
SendKeys "%(es)", wait
SendKeys "{down 2}", wait
SendKeys "{enter}", wait
SendKeys "^+h", wait
SendKeys "{y}", wait
SendKeys "^+h", wait
SendKeys "+{tab 2}", wait
SendKeys "{del}", wait


SendKeys "+{tab}", wait
SendKeys "{del}", wait
SendKeys "+{tab}", wait
End Sub
Reply With Quote
  #2  
Old 02-25-2012, 01:44 AM
JohnWilson JohnWilson is offline Convert To Freeform Windows 7 64bit Convert To Freeform Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,902
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

You can convert a selected shape to a frreform using the executemso method but I suspect this isn't really what you are trying to do so I have also added code to (I think) duplicate what your code does.
[CODE]Sub ConvertFF()
If ActiveWindow.Selection.Type <> ppSelectionShapes Then Exit Sub
Application.CommandBars.ExecuteMso ("ShapeConvertToFreeform")
End Sub[CODE]

Code:
Sub ungroupEMF()
Dim oshp As Shape
Dim oshpR As ShapeRange
Dim osld As Slide
On Error Resume Next
If ActiveWindow.Selection.Type <> ppSelectionShapes Then Exit Sub
Set osld = ActiveWindow.View.Slide
Set oshp = ActiveWindow.Selection.ShapeRange(1)
oshp.Copy
osld.Shapes.PasteSpecial(ppPasteEnhancedMetafile).Select
With ActiveWindow.Selection.ShapeRange
.Left = oshp.Left
.Top = oshp.Top
oshp.Delete
.Ungroup.Select
.Ungroup.Select
End With
End Sub
__________________
Microsoft PowerPoint MVP
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert .ost to .pst phoy Outlook 1 12-03-2011 07:07 PM
How do you convert to .MOV? pmr8888 PowerPoint 0 11-30-2011 04:32 PM
Convert To Freeform Convert PDF to PPT? Hinmini PowerPoint 1 10-28-2011 07:38 PM
Convert To Freeform How to convert PDF to jpg? gonner Outlook 1 10-28-2011 06:25 PM
convert golden039 Word 0 08-16-2009 05:48 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:17 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft