本文的准备步骤有:
1. 安装 VS2012
2. 安装office developer tool for VS2012 http://msdn.microsoft.com/en-US/office/apps/fp123627
3. 申请一个Office 365 试用账号 http://msdn.microsoft.com/en-us/library/office/apps/fp179924(v=office.15)
上篇博客中大致介绍了Office 2013 App概况 http://blog.csdn.net/farawayplace613/article/details/8950512。
本篇博客介绍task pane app(从新建到发布到office 365 SharePoint):
1. 新建office app 并编辑App
a. 启动 VS2012 , File->New->Project, 选择 'App for SharePoint 2013"
b. 点击 OK
c. 选择App类型后点击 OK
d. 更新General 设置
2. 在office 365 的SharePoint 上创建App catalog
a. 使用office 365 账号登陆 https://portal.microsoftonline.com/IWGetStarted15.aspx?DisableIWLanding=true
b. 点击Admin -> SharePoint
c. 点击 Apps => App catalogs
d. 向导会让你新建一个site collection做为app catalog , 如 https://wicresoftab.sharepoint.com/sites/catalog
3. 发布app
a. 点击 office app的project => publish
b. 新建一个profile
c. 输入要作为JS代码的宿主网站地址(必须是https的)
d. 点击Next- > Finish
e. 将生成的OfficeAppManifests下的OfficeApp1.xml(根据工程名不同)上传到(office 365 SharePoint)app catalog 的app for office 的目录中
4.将OfficeApp1Web工程发布到Host server 上(注意URL与上步新建publish 时的URL一致)
5.在word 2013 中设置app catalog 和 office 365 账号
a. 打开一个word 文档
b. File=> Option =>Trust Center => Trust Center Setttings .... => Trusted App Catalogs,输入app catalog 地址并点击"Add catalog"
c. 点击ok, 回到文档, File => Account => Add a service =>Storage= >Office 365 SharePoint
d. 输入office 365 账号,点击 Next
e. 输入office 365账号的密码后点击 sign in
f. 关闭word 文档
6. 在word 中插入app
a. 打开word 文档
b. 点击 Insert => App for office => select all
c. 点击"My organization"(第一次可能需要几分钟加载office 365 SharePoint app catalog 中的app), 选择对应的app点击插入
d. 应用程序载入成功后效果如下:
注意:
1. 如果不设置account, 在步骤6.b时会出现 access denied to catalog
2. 如果host 网站的SSL 证书设置不对,步骤6.d会出现加载错误。