Offline Online

Y

Yashr

Hello:

I need to know if a project is accessed online or offline using a Macro. How
can this be done? I tried
if (application.filesaveoffline=true) then 'do stuff
else 'do other stuff.

Looks like this code actually saves it offline. Any help is appreciated.

Thanks.
 
R

Rod Gill

A project shouldn't be available if its offline as the master data will be
on someone's PC or Laptop. You can still read data from Project Server but
not update it. Can't remember, but I'm sure you can also open a read-only
version of the schedule from Project Server but it won't have any edits made
offline until the schedule is checked in again.
 
C

Coolpran

Hi Yashr,

If you are using Project Server 2003, then yes, its possible to determine
whether a user has connected by clicking "Connect" or "Work Offline" in the
Project Professional Client.

Here is how you do it -

'----------- Start of Code ---------------
Function IsConnectionOnline() as Boolean
Dim objProf As Profile
Dim strRoot As Long
Dim strPath As String, strKeyName As String
Dim strGuidValue As Variant


' Get the Project Server Profile
Set objProf = Application.Profiles.ActiveProfile

'Debug.Print "Profile Name: " & objProf.Name
'Debug.Print "Login Type: " & objProf.LoginType
'Debug.Print "Server: " & objProf.Server
'Debug.Print "Type: " & objProf.Type
'Debug.Print "Username: " & objProf.UserName
'Debug.Print "Connection State: " & objProf.ConnectionState

If objProf.ConnectionState = PjProfileConnectionState.pjProfileOnline
Then
IsConnectionOnline = True
Else
IsConnectionOnline = False
End If

Set objProf = Nothing
End Function
'----------- End of Code ---------------

Let me know if this works out for you

Regards
Coolpran
 

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