Project.Activate event is missing

M

Mike

I need to know when the user has selected a different project, either by
opening one from disk or changing windows in Project. I see in the developer
reference that there is Activate event, but I can't find it with intellisense
(I am using c#). There is a Deactivate event but it doesn't produce the
desired result, that is - to know that a different project is currently being
displayed.

Regards
 
J

Jack Dahlgren

Going from memory... I think activate is at the application level.
Do you want to trap for when the user switches windows or are you just
checking to see which project is active?

I don't have an answer for the first situation, but you could check to see
if the project you are working on is the activeproject. Or you can set the
project you want as the active one:

Sub setFirstProjectAsActive()
WindowActivate WindowName:=Projects(1)
End Sub

I'm sure there is some way using system calls to find out which window is
which but I am not experienced in that sort of thing.

-Jack Dahlgren
 
S

Scudder

Mike ~ A s you've found coding C# Interop is less than perfect, I therefore
tend to prototype in VB6 (even though it's no longer supported), then
complete the work in C#.

I know this may sound like double the work, but it does save hours of
wrestling with C# correct casts and all that fun stuff. VB.Net is of course
really the weapon of choice for Interop since it is the more natural language
but like you I took the C# path.

Think of VB6 as your Meta code.
 

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