多个 Windows 上的 Powerpoint 2010 VSTO AddIn 任务窗格

发布于 2024-12-24 16:10:30 字数 963 浏览 2 评论 0原文

我希望在每个文档窗口上显示一个任务窗格,我已阅读所有有关它的 MSDN 文章,但它不起作用。

当打开 3 或 4 个文档时,我单击 ToggleButton1,并且我得到 3 或 4 个任务窗格,但在同一个文档窗口上。

编辑:

我想我没有正确解释这个问题,抱歉。

新尝试:当打开 3 或 4 个文档时,我单击演示文稿 1 窗口上的 ToggleButton1,并且在 Prestation 1 窗口内出现 3 或 4 个任务窗格,其他演示文稿中的窗口是空的。

我想要的是所有演示文稿的共享任务窗格和同步可见性

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

我也尝试过:

For Each w As PowerPoint.Presentation In Application.Presentations

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谎言月老 2024-12-31 16:10:30

在 PowerPoint 中,任务窗格在所有文档窗口。当您在演示文稿窗口之间切换时,将使用相同的任务窗格(这就是为什么当您为每个窗口添加任务窗格时会得到 3 或 4 个窗格 - 它们在演示文稿之间共享)。如果您想要单独的任务窗格,则需要在更改活动 DocumentWindow 时打开/关闭活动任务窗格(或单独管理每个演示文稿的任务窗格状态

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文