2016-05-10 8 views
-1

Word、Excel、およびPowerPoint用のOfficeJS Officeアドインを開発しています。OfficeJS OfficeアドインでアクティブなOfficeアプリケーションを識別する

JSを使用してアクティブなアプリケーション(Word、Excel、PPなど)を確認して、アクティブなアプリケーションを条件付ける方法を教えてください。例えば

Wordは他のアクティブコールのXである場合、ExcelがアクティブコールYであれば、PowerPointのコールZ.

答えて

2

場合は、新しいAPIのセットを使用していますか? もしそうなら、それらの要件セットモデルを使用してチェックすることができます。 https://dev.office.com/docs/add-ins/overview/specify-office-hosts-and-api-requirements 例:

if (Office.context.requirements.isSetSupported('WordApi', 1.1)) 
{ 
    // Do something in word 
} else if (Office.context.requirements.isSetSupported('ExcelApi', 1.1)) 
{ 
    // Do something in excel 
} 
関連する問題