Alternative to the Activate, or any activate event for c# ?

A

Alex Sille

Hi there,

recently I had to finish an proj2007 addin and then convert it to its
msproj2003 equivalent. I'm a bit confused that there is no Activate event
for c#. (or at least I can't find any, and I could not find any useful info
abou this on the net either). I'm new to office developement so correct me
about some of my satetments below.

Does anybody out there have a good workaround for this? It a bit painful for
me, as I need to get some of the doc properties when a new project is opened,
so I can categoryze or handle the project the approperiate way. As it it
turned out that I can't get the custom properties at the NewFile event.
I'm using a dumb backgroundworker method now and waiting for the application.
ActiveProject.ID like :

------
MSProject.Project apj = this.Application.ActiveProject;
if (this.Application.ActiveProject != null)
{
if (this.Application.ActiveProject.ID == waitForId)
{
e.Result = true;
break;
}
}
------

but sometimes this leads to an exception with a message that the application
is busy while calling :

MSProject.Project apj = this.Application.ActiveProject;

So this is not the best solution ... Using a try catch block at the moment ..
..

Would be happy to see any other event that I could replace the Activate
event with. Or is there an other solution. Am I using the wrong office tools
or o2003PIA ?

And what's the meaning of this : "Project events do not occur when the
project is embedded in another document or application"
I tryed to use the ActivePane.Deactivate event, but It's not fireing, where
can I use this event if not in msProject. The Application object does not
have an Application.ActivePaneDeactivating or something like tat event.

Many thanks for any help on this ...

url:http://www.ureader.com/gp/1117-1.aspx
 
A

Alex

Thanks for your answer,

that link was one of my guides while working on my add-in. The problem is
that I can see those events only in VB when I open the editor from MS
Project. But I can't see them in visual studio using C#.

I quess you were programming in VB. If no maybe I'm missing something for
proj 2003. I have no idea at the moment. Those evetns were available when I
was developing for 2007 project and it seems that they are missing for 2003.


url:http://www.ureader.com/msg/11173948.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top