Consulting

Results 1 to 2 of 2

Thread: VBA to Open Embedded Powerpoint Object in Normal Mode

  1. #1

    VBA to Open Embedded Powerpoint Object in Normal Mode

    Haven't found any useful information on the internet about this. I embedded a pptx file within a word document. I use some vba to open the ole object; however, the powerpoint is displaying in show mode, and I need it to open in normal mode. Is there a way to control this either through the code or the embedded object?

    Sub OpenPPT()
    'This sends directly to powerpoint
    '
    Dim oCC As Shape
    For Each oCC In ActiveDocument.Shapes
    If oCC.Title = "pptDisaster" Then
    oCC.TextFrame.TextRange.InlineShapes(1).OLEFormat.Edit
    Else
    ' Do Nothing
    End If
    Next
    End Sub
    Also, the OLE object, when I hit Alt+F9, I get a tag that says Powerpoint.Show.12. Not sure if that has anything to do with it.

    What do you guys think?

  2. #2
    Guys,

    I am pleased to say that after scouring the internet, I didn't find even a lead to a solution for this. Instead, I got to have fun experimenting with VBA. I went over commandbars, trying to change the view of the ppt after it was opened; however, the executemso failed each time. THEN I got to thinking. There is a right click action that will allow you to open an OLE Powerpoint Object in normal/edit mode. I recorded a macro of that action and BANG! SOLUTION!

    Below is the final code for those wondering. Hopefully this will help some of the other seekers out there:

    Sub OpenPPT()
    'This opens powerpoint in edit mode
    '
    Dim oCC As Shape
    For Each oCC In ActiveDocument.Shapes
    If oCC.Title = "pptDisaster" Then
    oCC.TextFrame.TextRange.InlineShapes(1).OLEFormat.DoVerb VerbIndex:=1
    Else
    ' Do Nothing
    End If
    Next oCC
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •