Duvdev
06-25-2014, 02:44 PM
Hello,
Not sure if I am attempting to do something that isn’t possible but I think I am a bit confused with the differences between InlineShapes and Shapes. I know that they can be converted but I am having issues with making the conversion on the copy.
To sum up what I am attempting to do is take a screenshot of a given application, run a Word macro to customize the screenshot then feed it over to PowerPoint to run a separate macro on the same screenshot. I can run the macros in either application with no issue but run into the issue when stringing them together.
After stepping through the macros it seems that my issue is related to the difference between InlineShapes and Shapes. I have been “anchoring” InlineShapes in Word then copy the shapes, force VBA to launch PowerPoint and finally edit the screenshots/move/etc. I have attempted to copy the screenshot that was operated on by Word, while that does appear to format the picture for PowerPoint I can no longer see it in Word. I also attempted to create two Objects (One As and InlineObject and the other as a Shape) and Set each object to the screenshot.
I have a feeling I am missing something small here, maybe when or how to assign object types. Also maybe it simply isn’t possible to operate on an InlineShape then copying/reassigning in PowerPoint.
Please let me know if anyone has any ideas, or if the description is too confusing.
Simplified Example:
Sub WordMacro ()
Dim wShape As InlineShape
Dim pptShape As Shape
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
‘ Operate on screenshot
Selection.Copy
Set wShape = Selection.InlineShapes(1)
‘ Activate PowerPoint App
Set pptShape = wShape.ConvertToShape
‘ Operate on pptShape
End Sub
Not sure if I am attempting to do something that isn’t possible but I think I am a bit confused with the differences between InlineShapes and Shapes. I know that they can be converted but I am having issues with making the conversion on the copy.
To sum up what I am attempting to do is take a screenshot of a given application, run a Word macro to customize the screenshot then feed it over to PowerPoint to run a separate macro on the same screenshot. I can run the macros in either application with no issue but run into the issue when stringing them together.
After stepping through the macros it seems that my issue is related to the difference between InlineShapes and Shapes. I have been “anchoring” InlineShapes in Word then copy the shapes, force VBA to launch PowerPoint and finally edit the screenshots/move/etc. I have attempted to copy the screenshot that was operated on by Word, while that does appear to format the picture for PowerPoint I can no longer see it in Word. I also attempted to create two Objects (One As and InlineObject and the other as a Shape) and Set each object to the screenshot.
I have a feeling I am missing something small here, maybe when or how to assign object types. Also maybe it simply isn’t possible to operate on an InlineShape then copying/reassigning in PowerPoint.
Please let me know if anyone has any ideas, or if the description is too confusing.
Simplified Example:
Sub WordMacro ()
Dim wShape As InlineShape
Dim pptShape As Shape
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
‘ Operate on screenshot
Selection.Copy
Set wShape = Selection.InlineShapes(1)
‘ Activate PowerPoint App
Set pptShape = wShape.ConvertToShape
‘ Operate on pptShape
End Sub