Powerpoint 2010 VSTO AddIn taskpane on multiple Windows

≯℡__Kan透↙ 提交于 2019-12-11 00:36:36

问题


I would like have a taskpane displayed on each document-windows, I have read all MSDN articles about it, but it doesn't work.

I click on ToggleButton1 when 3 or 4 document are open, and i get 3 or 4 TaskPanes, but on same document window.

Edit :

I think i don't have correctly explain the problem, sorry.

New try : I click on ToggleButton1 on Presentation 1 window when 3 or 4 document are open, and i get 3 or 4 TaskPanes inside Prestation 1 window, windows from other presentation are empty.

What i want is a shared taskpane and synchronized visibility accross all presentations

ThisAddin.vb

Public Class ThisAddin

    Public Sub Test()
        For Each w As PowerPoint.DocumentWindow In Application.Windows

            Me.CustomTaskPanes.Add(New UserControl1, "abc", w).Visible = True

        Next
    End Sub
End Class

Ribbon1.vb

Private Sub ToggleButton1_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles ToggleButton1.Click

    Globals.ThisAddIn.test()

End Sub

I also have tried with :

For Each w As PowerPoint.Presentation In Application.Presentations

回答1:


In PowerPoint, the task panes are shared across all document windows. As you switch between presentation windows, the same task pane is used (this is why you get 3 or 4 panes when you add task panes for each window - they are shared across presentations). If you want separate task panes you need to open/close the active task panes (or separately manage task pane state per presentation) as you change the active DocumentWindow



来源:https://stackoverflow.com/questions/8726030/powerpoint-2010-vsto-addin-taskpane-on-multiple-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!