Private Sub main()<BR/>
'NOTE: Search for ToDo and when appropriate modify
'the line of code below the ToDo comment.
'ToDo: Uncomment line below if registering the form in the private store.
'Set igetSG = CreateObject("Exoledb.StoreGuidFromUrl.1")
'Get the GUID for the registration process.
'ToDO: Uncomment line below if registering the form in the private store.
'Guid = igetSG.StoreGuidFromUrl("http://servername/exchange/Anystoreitem")
'Anystoreitem is just that, any store item in the store will get you the
'store url. It might be something like: "user1/inbox"
'Private store
'ToDO: Uncomment line below if registering the form in the private store.
'regURL = "http://servername/exchange/SystemMailbox" & Guid
'Non-MAPI TLH
'ToDO: Uncomment line below if registering the form in a non-MAPI TLH.
'regURL = "http://servername/vroot"
'Default Public Folder (MAPI TLH)
'ToDO: Uncomment line below if registering the form in a MAPI TLH.
'regURL = "http://servername/exadmin/admin/domain.com/public%20folders"
If Trim(regURL) = "" Then
Exit Sub
End If
'Fill the default schema folder with form registrations.
Set oCon = CreateObject("ADODB.Connection")
oCon.ConnectionString = regURL + "/##SchemaURI##/microsoft/exchangeV1"
oCon.Provider = "ExOledb.Datasource"
oCon.Open
'----------------------------------------------------
'Register the default page for the folder.
Set oRec = CreateObject("ADODB.Record")
oRec.Open "CustomPFRpt4.reg", oCon, 3, 0
oRec.Fields("DAV:contentclass") = "urn:schemas-microsoft-com:office:forms#registration"
'ToDo: Change content class to your custom content class.
oRec.Fields("urn:schemas-microsoft-com:office:forms#contentclass") = "urn:content-classes:message"
oRec.Fields("urn:schemas-microsoft-com:office:forms#cmd") = "open"
'ToDo: Change to appropriate URL.
oRec.Fields("urn:schemas-microsoft-com:office:forms#formurl") = "http://servername/public/pf/form.asp"
'ToDo: Change to appropriate URL.
oRec.Fields("urn:schemas-microsoft-com:office:forms#executeurl") = "http://servername/public/pf/form.asp"
oRec.Fields.Update
oRec.Close
'Further instructions.
MsgBox "Copy Form.ASP into the folder that is referenced when setting the urn:schemas-microsoft-com:office:forms#formurl. Enable script execution on the directory."
End Sub