Microsoft WORD add-in generated by generator-office can not load Office object - word-addins

I have not enough reputation to post pictures, you can see the similar question here: https://learn.microsoft.com/en-us/answers/questions/392363/word-add-in-generated-by-generator-office-can-not.html
According to the Microsoft official Office documentation, I tried to use Yeoman's generator-office to generate WORD add-in, and then use npm start to start, but in the Taskpane it always showed "Please sideload your add-in to see app body".
Using the Microsoft Edge DevTools Preview tool, I can see the missing Office objects.So this question has something to do with the version?
But when I visited this add-in via the web page, I can see that the Office object is loaded successfully.
Why is the Office object unsuccessful when accessing this add-in in WORD,and how can I fix this?
Recorded following on May 19th. I tried to executed this example on another computer with Win7 and Office Professional 2016,it works well.

I tried the Office 2019 Professional,this problem is solved. I don't know it's the problem of edition, or of activation.

Related

Is there official clipboard access from office-js for Word add-in?

I have reviewed the office-js docs and not found any formal way of working with the clipboard through a Word add-in.
I attempted to use the newer navigator.clipboard.writeText but it is automatically rejected by the internal Word browser (where the add-in is hosted) without prompting the user (like a browser does). I have not seen any associated support for permissions policy that can be used to communicate with Word that the add-in would like clipboard permissions.
So, I am resorting to the deprecated document.executeCommand('copy') for now, but am concerned that will get my add-in rejected by the MS App Store.
Is there an official/sanctioned way to use the clipboard from within a MS Word add-in?
OfficeJS doesn't provide anything for that. You may sill use the Document.execCommand() API which includes "copy", "cut" and "paste". But it was deprecated and may not work in the web browsers any longer.
Feature requests on Tech Community are considered, when the dev team go through the planning process. Use the github label: Type: product feature request at https://aka.ms/M365dev-suggestions .
It seems like there's one method Range.copyFrom of Excel rich client api. I can't find the alternatives either. Maybe you can ask to provide the new feature. Whether it could be in the future feature list or not may also take some time.

How to bind Office web addin dynamically on demand from host application(asp.net website)

For VSTO I have a provision to call it based on demand from my host application. Where as for web addin it is globally installed in server so it will be reflected if I open any word document. I want the addin to be activated programmatically from my host application(.Net/C# MVC). Please suggest how can I achieve this.
This isn't possible with Office Web Add-ins currently. Please go to Office Developer Voice and search to see if this idea has been suggested. If it has, vote for it. If it hasn't, make the suggestion.

is it possible to link a field to a property of a control in formregions

I am developing an add-in for outlook 2013/2016.
Thus far I've been using vbscript for my forms.
However, needing not to have code exposed to anyone
who knows how to hit'design this form' and for easier
upgrading I was considering to switch to formregions.
My problem is how to assign the properties of a control
created in c# form region in the way that is done in outlook forms
(that are meant to contain form regions)
But I cannot find any help and references for that purpose
Does anyone know of a workaround?or some documentation, maybe?
PS:Importing the form region results in error:
'The installation Path for outlook 15 cannot be determined'
(I am running vsto 15 in office 16 64-bit)
thnx for all the effort!!!
the conversation got quite long
and i am gratefull.
i have taken your answers into
account but i could not complete
the puzzle starting from all
of the points you made.
Instead i will answer this question
with a complete tutorial i found.
Actually it dates back to office 2007
(so i avoided it initially because,
you know, technologies change
but i tried on 2016 and verified it works!!!
the link is at :
http://www.informit.com/articles/article.aspx?p=1327185
You can persist any property on an item using PropertyAccessor.GetProperty/SetProperty or the UserProperties collection.

Office.js fails to initialize in Word add-in with Angular

I'm building an (JS based) add-in for Word and it seems that I'm somehow unable to properly load (or actually, initialize) the office.js library when using the add-in in Word, both online as well as the desktop clients. I cannot execute any functions related to the office.js.
I've done some debugging and I found out that the sample projects work just fine, based on that finding I removed Angular from my add-in and it works fine that way. I load the office.js in exactly the same way in both the projects with and without angular. Is there a known incompatibility between Angular and Office add-ins? I haven't been able to find anything on this.
Actually there is a common error that I, and others, have come across several times when building angular apps in the context of an Office add-in. The office.js initialize function is there to set-up the communication between the add-in frame and the Office host application. If the office.js does not respond to the host application within 5 seconds after loading the add-in, it will fail. In this case, what happens often is that the office.js is loaded after (or by) angular, by then the 5 seconds are gone. What you should do is bootstrap angular in your office initialize. A more elaborate explanation and a guide on how to do this can be found here: https://www.itunity.com/article/building-excel-2016-addin-angular-enhanced-officejs-2637

Word 2007 multiple BeforeClose event handling

I have office 2007 installed on the windows 7 platform.
In the Word application exists our supplier's add-in that catches BeforeClose document event and asks customer the question before exitting.
Now, I developed MY custom add-in that also catches BeforeClose document event and performs some operation.
The question is: HOW can I control, which of the "catching" will perform FIRST and which SECOND?
I need that MY add-in will work first and the supplier code will work after me, before the documnet will closed.
Thanks a lot in advance,
Milo
The only thing I can see would be the loading order of the addins. You might need to "name" your addin file so it loads first (not sure there is another way), then check if it effectively triggers first on all you system configurations.