none
VSTO: How to get the content from Outline panel for PowerPoint.

    Question

  • I have one PowerPoint Project to get the content from Outline Panel, so whether there is one way to get it from existing object in PowerPoint? Or another easy way to get it.

    I am using C#.

    Monday, August 26, 2013 8:45 AM

Answers

  • Hi qingjie,

    We can get the Outline Pane object through the code below. But we can only activate the outline pane, so I’m afraid we are not able to get the content of Outline Pane by PowerPoint Object model.

    namespace PowerPointAddInSample
    {
        public partial class TakePane : UserControl
        {
            public TakePane()
            {
                InitializeComponent();
            }
    
            private void ClickMe_Click(object sender, EventArgs e)
            {
                var app = Globals.ThisAddIn.Application;
    
                Pane outlinePane = null;
    
                foreach (Pane pane in app.ActiveWindow.Panes)
                {
                    if (pane.ViewType == PpViewType.ppViewOutline)
                    {
                        outlinePane = pane;
                    }
                }
    
                outlinePane.Activate();
            }
        }
    }

    As far as I know, you can save the PowerPoint document as "Outline/RTF" type to get the Outline content:

    app.ActivePresentation.SaveAs(@"c:\Drafts\outline.rtf", PpSaveAsFileType.ppSaveAsRTF);

    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



    Thursday, August 29, 2013 3:16 AM