Word Events

Add-in Express™ Support Service
That's what is more important than anything else

Word Events
 
Jens Damsgaard




Posts: 47
Joined: 2011-02-14
Hello,

I'm having the strangest problem. I have an Add-In Express AddIn that works with Word. I listen to 3 Word events NewDocument, OpenDocument and DocumentBeforeClose.

Theses events work fine if I'm inside Word working. However, we also have a webpage that opens wordtemplates ie creates new documents based on these templates. Depending on something that I haven't figured out yet different installer projects triggers the OpenDocument event instead of the NewDocument event. I have a solution with 2 Installer projects created by "Create Setup project" from the right mousbutton meny. One triggers NewDocument which is correct the other OpeDocument which is obviously wrong. The only difference that I can think of was that between creating the setup projects I changed the IstallForAllUsers property to true on my AddInModule. The first setup project works as it should.
Posted 06 Apr, 2011 06:46:14 Top
Jens Damsgaard




Posts: 47
Joined: 2011-02-14
Hello again,

It seems to behave differently in debug mode. If I debug the project the correct event (New Document) is triggered. However in release mode the wrong event (OpenDocument) is trigered.
Posted 06 Apr, 2011 07:26:41 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Jens,

I have a bunch of questions for you:
1. What OS and Office version do you use?
2. What version and build number of Add-in Express do you use?
3. Did you install the latest service packs for Office, OS, Visual Studio and .net?
4. Could you please tell me the exact/required steps to reproduce the issue on my side?

Thank you
.NET, Extended MAPI, Windows Phone & RT
Posted 06 Apr, 2011 07:39:17 Top
Jens Damsgaard




Posts: 47
Joined: 2011-02-14
Hello Eugene,

1) I'm running Windows 7 32 bit. Office 2007, The same problem exists on a Windows 7 64 bit Office 2010 machine.
2) 6.3.3052
3) Yes everything that is sent through Microsoft Update.
4) I have created a ADX Com AddIn, added addin express event handling and specifically NewDocument, OpenDocument, BeforeDocumentClose. To create the document we use Sharepoint.OpenDocuments on a template through a webpage. So I guess it's a bit tricky to reproduce. I've tried to just open a template from my desktop but then it triggers the correct event.
Posted 06 Apr, 2011 07:58:32 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Jens,

Did you install the SP1 for Windows 7 and SP2 for Office 2007? Also please note that you use an old build of Add-in Express 2010. You can download the latest build from our web site.

It looks like the issue is not related to Add-in Express. Please try to reproduce the issue with a regular VSTO project, or even better, with a shared COM add-in. Do they work as expected?
.NET, Extended MAPI, Windows Phone & RT
Posted 06 Apr, 2011 10:27:42 Top
Jens Damsgaard




Posts: 47
Joined: 2011-02-14
Hello Eugene

I actually have a Shared Com AddIn project that does this and works. The only difference is that now I listen to the Add-In Express event instead of the actual Outlook event itself. So I would argue your conclusion that Add-In Express doesn't have anything to do with my problem.

I will update to the latest version of Add-In Express.
Posted 07 Apr, 2011 10:24:19 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Jens,

Please keep me notified.
.NET, Extended MAPI, Windows Phone & RT
Posted 07 Apr, 2011 10:30:29 Top
Jens Damsgaard




Posts: 47
Joined: 2011-02-14
I have made a workaround. With som logic added I can do my stuff in the OpenDocument event aswell. Still there is a serious problem here. OpenDocument should not be called and as I stated before is not called if I run my code in debug mode. NewDocument should be called.
Posted 26 Apr, 2011 03:28:00 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Jens,

Could you please describe the issue in details? How can I reproduce it on my PC? Could you please tell me the required steps to reproduce it?
.NET, Extended MAPI, Windows Phone & RT
Posted 26 Apr, 2011 04:01:08 Top
Jens Damsgaard




Posts: 47
Joined: 2011-02-14
Hello Eugene,

I have a ADX COM AddIn project that targets amongst others Word.

I my AddInModule I have addded the following ADXWordAppEvents:

* DocumentBeforeClose
* DocumentOpen
* NewDocument

The events are implemented in my AddInModule.

The events are triggered in several different. Through a new document dialog, an open document dialog. These all works fine. Another way of creating a new document is through our product housed on a SharePoint server. The way we create new documents is by using Sharepoint.OpenDocuments on a template.

Creating a new document by way of Sharepoint.OpenDocuments workes fine in an older VSTO addin we have(we are replacing this with the an AddIn express version). The NewDocument event is triggered. It also works fine if I run the AddIn Express addin in debug mode. The NewDocument event is again triggered. However if I build a release version and run that the OpenDocument event is triggered and not the NewDocument event.

I have a workaround for myself handling the NewDocument Event inside the OpenDocument event but it seems you have a problem on your side regarding how the events are triggered.

This workes fine in a standard VSTO addIn we have (but are replacing with the one I'm developing).
Posted 26 Apr, 2011 04:22:59 Top