Profile object

 

Profile objects represents a particular profile with its providers and services.

 

Returned by:

Profiles.Item

Profiles.Add

Profile.Copy

 

The example below creates or reuses a profile and add a PST file.


PR_PST_PATH = &H6700001E
PR_DISPLAY_NAME = &H3001001E
ProfileName = "Test PST Profile"
PSTPath = "c:\MyNewPST.pst"
set Profiles=CreateObject("ProfMan.Profiles")
on Error Resume Next
Err.Clear
set Profiles=CreateObject("ProfMan.Profiles")
set NewProfile = Profiles.Item(ProfileName)
if Err.Number <> 0 Then
    set NewProfile = Profiles.Add(ProfileName, false, false)
End If
set Services = NewProfile.Services
bPSTFound = false
for i = 1 to Services.Count
    set Service = Services.Item(i)
    for j = 1 to Service.Providers.Count
        set Provider = Service.Providers.Item(j)
        if Provider.ProfSect.Item(PR_PST_PATH) = PSTPath Then
            bPSTFound = true
        End If
    next
next
If not bPSTFound Then
    set PstService = NewProfile.Services.Add("MSPST MS", "Personal Folders", false)
    set Properties = CreateObject("ProfMan.PropertyBag")
    Properties.Add PR_PST_PATH, PSTPath
    Properties.Add PR_DISPLAY_NAME, "The greatest PST file ever"
    PstService.Configure 0, , Properties
End If

 

Properties

Methods

 


Derived from: IDispatch


Properties


Default TRUE if
Boolean, read/write.
 
 
GlobalProfSect Return the global profile section (ProfSect).
Read-only.
 
 
Name Name of the profile.
String, read/write.
 
Services Returns the Services collection with all the services in a profile.
 
 

Methods


Copy(NewProfileName) Copy the profile to a new profile with the given name. Returns new Profile object.
 
Delete Deletes the profile.
 
OpenProfileSection(GUID) Opens a profile section (ProfSect) with the given GUID.