Office アドイン

[Office用アプリ]JavaScript API for Office ライブラリ v1.1

2014/01/24 追加記事を書きました。
・[Office用アプリ]JavaScript API for Office ライブラリ v1.1が公開されました。
//www.ka-net.org/blog/?p=3948

MSDNにいつの間にか新しいバージョンのJavaScript API for Office ライブラリの情報が出ていました。

・JavaScript API for Office v1.1 changes
http://msdn.microsoft.com/ja-jp/library/dn482462.aspx
・Schema reference for apps for Office manifest (v1.1)
http://msdn.microsoft.com/ja-jp/library/dn482556.aspx

現在(2013/12 時点)のライブラリは 1.0 メジャーバージョンのみがリリースされていますが、下記ページを見る限り、Office 2013 SP1のリリースに合わせて新しいライブラリが公開されるのだろうと思います。

・What’s new for developers in Office 2013 SP1 Technical Preview
http://msdn.microsoft.com/ja-jp/library/dn481136.aspx

  • Using the new Navigation API, apps now have a way to navigate within the document view to different parts of a document, worksheet or presentation. The Navigation API lets Office 用アプリ navigate and focus the view on specific objects and locations in the document.
  • The new Formatting API enables developers to set and update formatting for tables and data within them in apps for Excel. Data formatting is the set of attributes that describe the presentation and the type of the data. Examples for presentation attributes are font color, border style, and text alignment. Examples for type attributes are number, date, currency, and so on.
  • The new File Properties API enables developers to access and modify the properties of an Office file. This API is common across Word 2013, Excel 2013, and PowerPoint 2013.
  • The Table Binding API is now enhanced to work with matrix data in addition to table data. In Excel 2013 and Excel Web App, the Office 用アプリaddFromPromptAsync, addFromSelectionAsync, and addFromNamedItemAsync methods can now be called with the Office.BindingType.Table argument, they can bind to a contiguous range of cells as a table -even when that data was not originally added to the spreadsheet as a table using the Insert > Tables >Table or Home > Styles > Format as Table commands.
  • The user experience when inserting an Office 用アプリ that binds to selected data has been improved. Previously, after selecting data and choosing to insert an app to bind to that data would fail. With this improvement, the app can bind to the data the user selected when the app is inserted. Developers can bind to table, matrix, and text data selected by the user when their app is inserted in Excel 2013 and Excel Web App.

上記ページにあるAPIの拡張部分に関する概要を見てみると、新しいナビゲーションAPIの実装やテーブルの書式設定、ファイルのプロパティAPI追加など、 v1.1 ではOffice 用アプリでできることが結構増えるみたいで、テーブルの装飾(Excel向けOffice 用アプリ)に関してはすでに下記ページで情報が公開されています。

・How to: Format tables in apps for Excel
http://msdn.microsoft.com/ja-jp/library/dn535872.aspx

また、下記ページではローカル開発環境でのライブラリ更新手順(NuGet Package Manager使用)について書かれていたので、NuGet Galleryを確認してみたのですが、こちらはまだ v1.0 のままでした。
現時点では、Office 2013 SP1 Technical Previewユーザーでないと新しいライブラリが使えないのかもしれません。
(Visual Studioからは確認していないので分かりませんが・・・)

・How to: Update the JavaScript API for Office files in your Visual Studio project from version 1.0 to 1.1
http://msdn.microsoft.com/ja-jp/library/dn535869.aspx

ちなみに、NuGetのパッケージは「Installing NuGet」で公開されているコマンドラインユーティリティを使えば、Visual Studioが無くても簡単にインストール可能です。
(たとえばOffice Javascript APIの場合はコマンドプロンプトから「nuget install “Microsoft.Office.js”」を実行すればnuget.exeと同じ場所にパッケージが展開されます。)

来年初めに Office 2013 Service Pack 1 をリリース」という話もすでに出ていますし、新しいライブラリが利用できるようになるのは時間の問題だと思いますが、早く新機能を試してみたいものですね!

2013/12/26 追記:

■ Office ホスト アプリケーションについて

・How to: Specify the Office host applications your app supports using the version 1.1 manifest
http://msdn.microsoft.com/ja-jp/library/dn535870.aspx

上記ページを見ると、

The Hosts element is a new optional element added in version 1.1 of the manifest. This element lets you specify the target Office host applications you want your app to run in. If the Hosts element isn’t specified in the manifest, the app should run in all hosts that support the API requirement sets and/or methods specof Requirements (for information about how to specify the Requirements element, see How to: Specify API requirement sets and methods for your app). In version 1.1 of the manifest, the Hosts element is essentially a replacement for the Capabilities element from the version 1.0 manifest.

とあり、これまでマニフェストファイルでホスト アプリケーションの指定に使っていた「Capabilities」「Capability」要素の代わりに「Hosts」「Host」要素を使うことになるみたいです。

<Capabilities>
  <Capability Name="Document" />
  <Capability Name="Workbook" />
  <Capability Name="Presentation" />
</Capabilities>

から下記のような形に変更。

<Hosts>
  <Host Name="Document" />
  <Host Name="Workbook" />
  <Host Name="Presentation" />
  <Host Name="Database" />
</Hosts>

ここで驚いたのはHost要素、Name属性の値に「Database」が追加されていること。
つまり v1.1 ではAccessでもOffice 用アプリが使えるようになるみたいです。
AccessのOffice 用アプリ = カスタム Web アプリ、では無かったということでしょうか・・・!?

■ マニフェストファイルの変更点

・How to: Specify API requirement sets and methods for your app
http://msdn.microsoft.com/ja-jp/library/dn535871.aspx

上記ページを見ると、

The Requirements element is a new optional element in the version 1.1 manifest. This element lets you specify named sets of API methods or individual methods that your app requires in order to run.

とあり、アプリで使う機能はマニフェストファイル側で「Requirements」要素で指定しておく必要があるみたいです。
ライブラリに合わせて、マニフェストファイルも大分変わるみたいですね。

[Office用アプリ]Apps for Office サミット!で登壇しました。前のページ

2014年、今年も初心者備忘録をよろしくお願いいたします。次のページ

関連記事

  1. Office関連

    マクロでリボンを最小化する。

    mougの回答用に書いたコードです。忘れないうちにメモ。・…

  2. Office アドイン

    [Office用アプリ]サポートページにある資料へのリンクをまとめてみました。

    MicrosoftのサポートページにあるOffice 用アプリや関連技…

  3. Office関連

    選択中の図形の書式設定を一括変更するPowerPointマクロ

    PowerPointで複数の図形の書式を一つずつ変更するのが面倒だった…

  4. Excel

    [Excel VBA]PrintPreview後に印刷するとCtrl+;の日付形式が変わる?

    MSDNフォーラムで面白い質問がありました。・Excel …

  5. Office アドイン

    [Officeアドイン]ワークシートで選択範囲を変更したときに発生するイベント

    ワークシート上で選択範囲の変更を検知する際、VBAでは通常「Works…

  6. Office関連

    Office 2010 開発者用リファレンスをHTML形式で”快適に”閲覧す…

    前回の記事で7-Zipを使ってHXS形式のOffice製品のヘルプを解…

コメント

  1. この記事へのコメントはありません。

  1. この記事へのトラックバックはありません。

Time limit is exhausted. Please reload CAPTCHA.

※本ページはプロモーションが含まれています。

Translate

最近の記事

アーカイブ

PAGE TOP