Word 2007 multiple BeforeClose event handling - 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.

Related

word add-in using OfficeJs

We already developed Excel add-in using officejs with RESTful api with Batching in custom Functions.
And we wanted to achieve same in Word add-in hence kindly share example using word add-in with RESTful api.
As I understand it, you have a web API (REST architecture) and you have successfully made calls to it from an Excel custom function. Now you want to make calls to a web API from a task pane Word add-in. You should be able to do this exactly the same way that you do in the custom function. In fact, to start with, you should use the exact calling code and get the exact same data. The difference is only in the UI. You will probably want the calling code triggered by an event handler for a button in the task pane.
As per my knowledge, you need word manifest.xml file then all your business logic you can write using differences your addin by running inside excel or word
So officejs provide Host info to check running platform
I guess it will help

How can I format text without changing document state in MSWord web add-in API?

I'm developing an add-in for MSWord using Microsoft web add-in API. I'd like to underline or highlight some given words, but only in the scope of that session. I don't want to change the document's state. In other words, I don't want to persist the new text formatting when the document is saved.
I know how to format text, but the document's state is changed. I have this code at the moment:
word_range.font.underline = Word.UnderlineType.wave;
I want to achieve a behavior similar to Grammarly plug-in, where the underline is only to point out something is wrong with those words, but again, without persisting the underlining.
I found a similar question (word - highlight search results without permanently changing document formatting), but it was asked a few years ago and the solution is not exactly what I'm looking for.
I'm afraid that there is no way to highlight that will automatically disappear if the user saves the document. The answer that you linked to, or this one is the best that can be done in Office.js right now. It is a good idea, however, so please suggest it at Office Developer Suggestion Box.

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

Custom Ribbons - per DOTM

we have a possible customer, who would like to have a custom ribbon in ONE template, which makes it for him easier to design the text etc.
This stuff should work on Office 2007, 2010 and 2013.
Since this will go to thousands of people, the easiest solution for this would be, to implement Macros, which do the Design-Stuff.
It seems to be no problem (I tested only with 2013) to create a custom ribbon and connect it to macros, it seems even to be possible to define custom Icons.
The real problem causess the Ribbon itself. Since, if I activate my custom ribbon, it's activated for all documents, I have to anyhow create a macro, which makes it visible JUST for one template.
Is this even possible, or is there a possibility to define a Ribbon per dotm? I didnt find anything about that, but what I found makes me nervous about the 2007, 2010, 2013 thing...
Or is it easier to create an Addin, which is kindahow compatible with alle 3 Versions?
Use Visual Studio and start a Word Template project. You can use VB if macros are to your liking or C#.
Your future documents will have to have the template attached for the ribbon to show up, which in my experience has proven to be a pain.
Alternatively you can create an addon that handles document-open events and checks if the document looks like what you expect it to look like. Heuristics can be very tricky if you don't have very specific indicators (such as an attached template, schema or content tags)
Another suggestion, which would most likely be acceptable to users, is to write an addon that shows and hides its main ribbon tab but has a ribbon button to "activate" the document and when you click that button (on another tab) it attaches your template or assigns some other persistent indicator to the document. This addon would also check each document when opened for that indicator and automatically show the actual ribbon tab when the document is recognized.