ActiveProfile.ConnectionState

E

Erik K

Has anyone noticed that app.Profiles.ActiveProfile.ConnectionState always
returns pjProfileOnline, regardless of the status of Project Pro 2007? I am
doing automation through an add-in and it's vital that I know the connection
state.

BTW, I am on SP2.

Cheers,
Erik
 
A

Assaf

Hi Erik,
Do you want to check if the current user session is connected to a server or
is he working on the local computer? Or do you want to make sure he's working
in online or offline modes?
 
E

Erik K

Hi Assaf,
Thanks for responding, it's the latter. I am already checking the profile
type, which works fine. I am unable to determine the profile's connection
state. It's really easy to repro this error... Open Project Pro and connect
to a Project Server profile. Then right click on the "Connected" icon on the
status bar at the bottom and select "Work Offline". Open VBA and in the
immediate window type
"?application.Profiles.ActiveProfile.ConnectionState=pjProfileOnline". It
will return "True". I get the same behavior in a vsto add-in. It seems like a
bug, but I have not seen it mentioned anywhere as such.
Cheers,
Erik
 
E

Erik K

Hey Assaf,
Nice suggestion... Thanks!
Erik

Assaf said:
Hi Erik,
I never met this issue,
However, I can suggest a workaround - see if the File menu of MS Project
contains the item "Save Online" - if the item exists in the menu, you're
working offline, else- you'r online

You can access the menu items using CommandBar object (small code sample
that I found - http://support.microsoft.com/default.aspx/kb/302901, MSDN
article -
http://msdn.microsoft.com/de-de/library/microsoft.office.core.commandbar(office.11).aspx)

HTH
 
E

Erik K

Follow-Up... Use Application.Profiles.ActiveProfile to determine whether the
current profile is Local or Server profile, and Application.IsOffline to
dermine the current connection state.
 

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