将Word模板添加到自定义功能区

问题描述:

你好,确定这是一个很好的答案。

Hello, sure this is a nice easy answer.

我们有一个自定义功能区,想要一个打开的按钮共享模板。无法找到一种方法,我可以添加一个打开标准的Word模板页面,从中选择所有模板,但无法解决如何添加直接单击按钮?

We have a custom ribbon and would like a button that opens a shared template. Can't find a way of doing it, I can add one to open the standard Word Templates page where you select from all the templates but can't work out how to add a direct one click button?

谢谢

hi,

在自定义按钮的OnAction回调中,你可以引用这个子:

in the OnAction callback of your custom button you could reference this sub:

Public Sub CreateNew()
    Dim oDoc As Document
    Set oDoc = Documents.Add(Template:="the full name of your template")
End Sub




Lauro


Lauro