如何在 Visual Studio 中制作 Office 加载项(Office 应用程序)以打开模板文件而不是新工作簿? [英] How to make Office Add-in (Apps for Office) in Visual Studio to open a template file instead of a new workbook?

查看:49
本文介绍了如何在 Visual Studio 中制作 Office 加载项(Office 应用程序)以打开模板文件而不是新工作簿?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的 office 加载项需要在文档中提供一些数据,然后才能处理请求.在 Visual Studio 中运行 Apps for Office 项目模板时,有没有办法打开文档模板而不是打开空白文档(word 或 excel)?

解决方案

您需要将模板文档添加到清单"项目,然后将开始文档"属性设置为指向您的文件,而不是新建"Excel 工作簿"(或它设置的新文件类型).

它看起来像

设置起始文档

Our office add-in is expecting some data to be available in the document before it can process the requests. When running Apps for Office project template in Visual Studio, is there any way to open up a document template instead of opening a blank document (word or excel)?

解决方案

You will need to add your template document to the "Manifest" project, and then set the Start Document property to point at your file, rather than a "New Excel Workbook" (or what new file type it's set to).

It looks like http://simonjaeger.com/apps-for-office-use-a-custom-start-document/ describes the step-by-step process. Including two of the pictures from his site below, see the blog post itself for the text content if the pictures don't guide you all the way there.

Add/include file to manifest solution:

Set start document

这篇关于如何在 Visual Studio 中制作 Office 加载项(Office 应用程序)以打开模板文件而不是新工作簿?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆