apps-for-office

How should range.expandTo be used in the word javascript api

梦想与她 提交于 2019-12-08 03:36:54
问题 I have created a taskpane addin for word that runs a search and will select the text between two search results. Until a couple of days ago the following code was running successfully: function onExpandTestClick() { var textToFind = "Word", range; return Word.run(function(context) { var searchResults = context.document.body.search(textToFind, { matchWildCards: false }); context.load(searchResults, "text"); return context.sync() .then(function() { range = searchResults.items[0].getRange("End")

How should range.expandTo be used in the word javascript api

♀尐吖头ヾ 提交于 2019-12-07 13:14:27
I have created a taskpane addin for word that runs a search and will select the text between two search results. Until a couple of days ago the following code was running successfully: function onExpandTestClick() { var textToFind = "Word", range; return Word.run(function(context) { var searchResults = context.document.body.search(textToFind, { matchWildCards: false }); context.load(searchResults, "text"); return context.sync() .then(function() { range = searchResults.items[0].getRange("End"); var rangeEnd = searchResults.items[1].getRange("Start"); range.expandTo(rangeEnd); context.load(range

Excel JS Add-In works in Excel but not Excel Online

孤人 提交于 2019-12-07 01:56:28
I've built an Excel JS Task Pane add-in using the WoodGrove Expense Trends sample and have validated that it runs correctly in Excel 2016 on my machine. However, when I go to Excel Online and try to add the add-in (via uploading the manifest from my machine), I get "Your add-in manifest is not valid." I'm not sure what it is about this manifest that's valid on my machine but not in Excel Online. Anyone encountered this before or have any diagnosis ideas? It's somewhat akin to banging my head into a wall at this point. Michael Zlatkovsky - Microsoft Taking a guess from looking at the manifest,

Change word document style with an app for Office

好久不见. 提交于 2019-12-02 02:33:49
Im trying to create an app for Word Office using the Office js API. I have found how to get and set content into the word document but Im having a hard time finding how to change things like Styles (Headings, etc.) Before getting into how to do it, is it even possible? The answer to you question is yes and now, the word api is a bit new and missing some functionalities which may make a developer life easier. First, headers are not supported in the word api, a work around for this is to create a Content control and use it as a header. I am currently using this work around in a word app that I

How can a range be used across different Word.run contexts?

冷暖自知 提交于 2019-11-28 10:31:50
I have created a taskpane addin for word that runs a search and displays information about the results as a list to the user. When the user clicks on an item in the list I want to select the range in word to show the user the location of the item. The addin will then allow the user to perform additional tasks on the range, for example change the font colour. I am able to run the search and get ranges for display using the function below: function runSearch(textToFind) { var items = []; return Word.run(function(context) { var options = Word.SearchOptions.newObject(context); options

What browser / browser engine do Office Add-ins use?

扶醉桌前 提交于 2019-11-28 01:58:51
So I am trying to get started developing Office 365 Add-ins (previously Apps for Office), and I was wondering what browser or browser engine Office uses when it renders your app. I tried using JavaScript's navigator.appCodeName and navigator.appName , but due to the problem described here renders that method useless. What browser or engine do Office Add-ins use to render apps? It depends on where Office is being used. If it's on Windows Desktop, Office Add-ins use an Internet Explorer to load the hosted webpage in Office. For iOS, it will rely on the native WebView control. If on Office Online

How can a range be used across different Word.run contexts?

家住魔仙堡 提交于 2019-11-27 03:39:53
问题 I have created a taskpane addin for word that runs a search and displays information about the results as a list to the user. When the user clicks on an item in the list I want to select the range in word to show the user the location of the item. The addin will then allow the user to perform additional tasks on the range, for example change the font colour. I am able to run the search and get ranges for display using the function below: function runSearch(textToFind) { var items = []; return