Microsoft Office開發工具 Visual Studio 2015

來源:互聯網
上載者:User

Microsoft Office開發工具 Visual Studio 2015

針對Office開發工具微軟推出了Visual Studio 2015,支援Clang編譯器和LLVM架構,同時可以為Android及未來的iOS開發應用。Visual Studio 2015支援Java、ANT、SQL LITE和WebSocket4web,提供原生的Git支援。使用者可以在新版中嘗試建立新的項目類型,下面將重點介紹一下安裝步驟和新功能。

安裝步驟如下:

  1. 如果還沒安裝Visual Studio 2015,立即點擊擷取Visual Studio  Community 2015,完全免費!
  2. 通過aka.ms/GetLatestOfficeDevTools擷取最新版本的Office開發套件。
  3. 請確保您已安裝Outlook 2016。

新功能:支援外接應用是重點

Visual Studio 2015的新功能有很多,除了能夠原生地支援在ECMAScript 2015中定義的一部分新的語言結構,讓JavaScript編輯工具利用Visual Studio中內建的工作清單,讓JavaScript編輯更簡單之外,Visual Studio 2015還支援直接產生Linux二進位程式。但是,這裡將著重介紹Office外接應用的功能。

在Visual Studio 2015新版中,Team Dev已經在Office外接應用中添加一個新的項目類型,叫做Outlook Add-in with Commands。外接應用可以在Outlook功能區添加按鈕,啟動外界程式顯示菜單或者執行一個自訂的JavaScript函數,為使用者提供一個無縫的辦公室體驗。

用VersionOverrides在清單中聲明一個命令,忽略舊版本的Office,從而確保與使用者的相容性。

現在可以建立一個撰寫電子郵件時插入自訂文本的增益集。當報告有關問題時,客戶支援人員通常需要詢問更多的細節,給出使用說明如何尋找版本,序號等。它會非常方便—節省大量的時間—在Outlook中插入這種常見的文本按鈕。Team Dev還將逐步通過一個樣本來建立一個寫電子郵件時插入自訂文檔的增益集。

在Visual Studio 2015中,通過檔案 > 新項目,選擇模板 > Office/SharePoint > Outlook Add-in with Commands建立新 Outlook 增益集命令項目:

若要查看這些按鈕,在解決方案管理器中選擇OutlookAddIn節點,在屬性視窗中將啟動操作改為辦公室案頭用戶端,然後啟動Outlook 2016,並按F5:

正如你所看到的,通過選擇顯示所有的屬性按鈕啟動外界程式,當使用者閱讀資訊時(在清單中定義MessageRead)出現在功能區。現在當使用者在撰寫郵件 (MessageCompose 表面) 時在功能區添加一個功能表按鈕。

停止調試,然後在方案總管上點擊OutlookAddInManifest節點,並開啟 XML 檔案清單。

在</ExtensionPoint>標籤結束處,向MessageCompose內添加一個添加功能表按鈕的ExtensionPoint標籤。
…
<ExtensionPointxsi:type="MessageComposeCommandSurface">
< OfficeTabid="TabDefault">
< Groupid="msgComposeDemoGroup">
< Labelresid="groupLabel" />
< Controlxsi:type="Menu"id="msgComposeMenuButton">
< Labelresid="menuComposeButtonLabel" />
< Supertip>
< Titleresid="menuComposeSuperTipTitle" />
< Descriptionresid="menuComposeSuperTipDescription" />
< /Supertip>
< Icon>
< bt:Imagesize="16"resid="icon16" />
< bt:Imagesize="32"resid="icon32" />
< bt:Imagesize="80"resid="icon80" />
< /Icon>
< Items>
< Itemid="msgComposeMenuItem1">
< Labelresid="menuItem1ComposeLabel" />
< Supertip>
< Titleresid="menuItem1ComposeLabel" />
< Descriptionresid="menuItem1ComposeTip
" />
< /Supertip>
< Icon>
< bt:Imagesize="16"resid="icon16" />
< bt:Imagesize="32"resid="icon32" />
< bt:Imagesize="80"resid="icon80" />
< /Icon>
< Actionxsi:type="ExecuteFunction">
< FunctionName>addMsg1ToBody</FunctionName>
< /Action>
< /Item>
< Itemid="msgComposeMenuItem2">
< Labelresid="menuItem2ComposeLabel" />
< Supertip>
< Titleresid="menuItem2ComposeLabel" />
< Descriptionresid="menuItem2ComposeTip
" />
< /Supertip>
< Icon>
< bt:Imagesize="16"resid="icon16" />
< bt:Imagesize="32"resid="icon32" />
< bt:Imagesize="80"resid="icon80" />
< /Icon>
< Actionxsi:type="ExecuteFunction">
< FunctionName>addMsg2ToBody</FunctionName>
< /Action>
< /Item>
< /Items>
< /Control>
< /Group>
< /OfficeTab>
< /ExtensionPoint>
…
在清單末尾的Resources節點處,用下面的代碼替換 ShortStrings 和 LongStrings的節點
…
<bt:ShortStrings>
< bt:Stringid="groupLabel"DefaultValue="My Add-in Group"/>
< bt:Stringid="paneReadButtonLabel"DefaultValue="Display all properties"/>
< bt:Stringid="paneReadSuperTipTitle"DefaultValue="Get all properties"/>
< bt:Stringid="menuComposeButtonLabel"DefaultValue="Insert message"/>
< bt:Stringid="menuComposeSuperTipTitle"DefaultValue="Choose a message to insert"/>
< bt:Stringid="menuItem1ComposeLabel"DefaultValue="Insert custom message #1"/>
< bt:Stringid="menuItem2ComposeLabel"DefaultValue="Insert custom message #2"/>
< /bt:ShortStrings>
< bt:LongStrings>
< bt:Stringid="paneReadSuperTipDescription"DefaultValue="Opens a pane displaying all available properties. This is an example of a button that opens a task pane."/>
< bt:Stringid="menuComposeButtonTooltip"DefaultValue="Inserts your choice of text into body of the message."/>
< bt:Stringid="menuComposeSuperTipDescription"DefaultValue="Inserts your choice of text into body of the message. This is an example of a drop-down menu button."/>
< bt:Stringid="menuItem1ComposeTip"DefaultValue="Inserts custom message #1 into the body of the email." />
< bt:Stringid="menuItem2ComposeTip"DefaultValue="Inserts custom message #2 into the body of the email." />
< /bt:LongStrings>
…
最後,在 functions/functions.js 的結尾處添加一些自訂的 JavaScript 函數:
…
// Adds text into the body of the item, then reports the results to the info bar.
function addTextToBody(text, icon, event) {
Office.context.mailbox.item.body.setSelectedDataAsync(text, 
{ coercionType: Office.CoercionType.Text },
function (asyncResult) {
if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {
statusUpdate(icon, "\"" + text + "\" inserted successfully.");
} else {
Office.context.mailbox.item.notificationMessages.addAsync("addTextError", {
type: "errorMessage",
message: "Failed to insert \"" + text + "\": " 
+ asyncResult.error.message
});
}
event.completed();
});
}
function addMsg1ToBody(event) {
addTextToBody("Custom message #1", "icon16", event);
}
function addMsg2ToBody(event) {
addTextToBody("Custom message #2", "icon16", event);
}

現在運行增益集查看新菜單。因為我們將菜單添加到MessageCompose上,你需要點擊Outlook 2016左上方的建立新郵件表徵圖建立一封新郵件。

就是這個!您已成功添加外界命令程式。如果想學習更多並深入探究如何將命令添加到Office Add-in可以查閱Overview of add-in commands for mail和Create a manifest for add-in commands。

Visual Studio 2015 Update 2 RC 發布,微軟整合式開發環境

Visual Studio Code 簡單試用體驗 

Visual Studio Code試用體驗 

Visual Studio 2010 & Help Library Manager 安裝說明

OpenCV 2.3.x/2.4.x在Visual Studio 2005/2008和Visual Studio 2010配置方法詳解

使用OpenCV-2.4.0.exe檔案編譯x86或x64平台Visual Studio 2005/2008/2010目標檔案

Visual Studio LightSwitch增加對HTML5和JavaScript的支援

Visual Studio 11:使用 C++ 開發一個最簡單的 Metro 應用

Visual Studio 的詳細介紹:請點這裡
Visual Studio 的:請點這裡

本文永久更新連結地址:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.