Word.Application.Activate() fails

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

Word.Application.Activate() fails
 
Patrick Jox




Posts: 83
Joined: 2009-05-09
Sorry, that I have to come back to this topic. I am sure this is not an issue of Add-In-Express. But here are the experts.

I am still having problems when opening word, create a new document and then activate word before fill it out.

Here is my code.

wa.DocumentOpen += new Word.ApplicationEvents2_DocumentOpenEventHandler(wa_NewDocument);
				
wd = wa.Documents.Add(ref template, ref missing, ref missing, ref missing);
appstarted = false;

while (!appStarted)
    System.Threading.Thread.Sl eep(10);

wa.DocumentOpen -= new Word.ApplicationEvents2_DocumentOpenEventHandler(wa_NewDocument);

wa.Visible = true;
wa.Activate();


In DocumentOpen event the value of appStarted is set to true. I tried also the NewDocument event to wait for. But no result.

Kind regards
Patrick
Posted 16 Oct, 2010 08:38:50 Top
Eugene Astafiev


Add-in Express team


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

What Office version do you use? Please note that the Activate method was introduced with Office 2010.
.NET, Extended MAPI, Windows Phone & RT
Posted 16 Oct, 2010 12:22:32 Top
Patrick Jox




Posts: 83
Joined: 2009-05-09
I use Office 2010. But I used the Activate Method before. The application was written using Office 2007 and the problems only exist in combination with Office 2010.

Your link leads me to ribbon stuff. But I want to activate the application itself.

Kind regards
Patrick
Posted 16 Oct, 2010 17:02:12 Top
Eugene Astafiev


Add-in Express team


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

Sorry for misleading you. I thought you meant the Activate method of the Ribbon tab.

First of all, please try installing a fresh build of Add-in Express. Are you able to reproduce the issue with a newly created add-in project? If so, could you please send it to the support e-mail address (see readme.txt)?
.NET, Extended MAPI, Windows Phone & RT
Posted 18 Oct, 2010 10:05:02 Top
Patrick Jox




Posts: 83
Joined: 2009-05-09
Eugene, sorry for the delay. I am just delivering an application. I will install the updated build after that. The client is using office 2007 and here it works.

I'll come back later to this.

Kind regards
Patrick
Posted 25 Oct, 2010 03:04:29 Top
Eugene Astafiev


Add-in Express team


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

Good news! Thank you for letting me know!

Anyway, please keep me notified.
.NET, Extended MAPI, Windows Phone & RT
Posted 25 Oct, 2010 06:46:34 Top