Properties of Items such as Task, Journal, Note created on Exchnage server 2000

Properties of Items such as Task, Journal, Note created on Exchnage server 2000

Post by jay » Sat, 18 Feb 2006 20:22:43


Hi all,
I am trying to read the properties of Items created on Exchnage server
2000 using Outlook. I searched through the archive of previous posts
on this group but i have not got complete idea about difference in
OUTLOOK item and EXCHNAGE SERVER item . Can anyone tell me how the
items created in Outllook are stored ?? and where ?? From what i have
read so far , i think when the server is Microsoft exchange server
2000, outlook doesnt create any Personal folder(pst) .So the items are
directly created on Exchange server itself ..Is this correct ?? and if
yes , where are the other properties stored ?? Are they stored on the
exchangeserver itself along with other properties or outlook stores
them somewhere else ?? I have refered to www.cdolive.com and tried to
retieve the properties of task items using CDO.Item but could not get
anyhting.I get error that property doesn't exist..

Any help in this regards will be gr8 ly appreciated !!
Jay
 
 
 

Properties of Items such as Task, Journal, Note created on Exchnage server 2000

Post by Henning Kr » Sat, 18 Feb 2006 20:31:35

Hello Jay,

When you use Outlook as stand-alone application (using POP3 or IMAP4),
Outlook uses a personal store (PST) file. Everything (Emails, contacts,
notes, etc) is stored there. If you use Exchange, all these things are
stored on the Exchange server. If you are using Outlook 2003 cached mode,
then a copy of all that is stored locally in a offline store (OST) file, and
synchronized with the Exchange server whenever you are online.

CDOLive is a good resource for those "special" items like task, because they
are not well covered by the other access technologies, like CDO or MAPI. In
fact, the only "official" way to deal with task items is to utilize the
Outlook Object model.
That said, you should be able to get those properties with CDO any other
access technlogy.

Please post your code where you try to retrieve these special properties.

Greetings,
Henning Krause

 
 
 

Properties of Items such as Task, Journal, Note created on Exchnage server 2000

Post by jay » Sat, 18 Feb 2006 20:56:06

i Henning ,
Thanks for ur reply ..
Here is some part of my code ..

and StFolder is set to the folder path from which the items are to be
queried ..

Private Sub QueryFolder(StFolder As String)
StartOperation "2. Doing List of folders in the mailbox"
AddLog "URL_BASE=" & URL_BASE
Dim strSearchSql As String
Dim strSourceFolderUrl As String
strSourceFolderUrl = ""
strSearchSql = "select "
strSearchSql = strSearchSql & "
""urn:schemas:mailheader:content-class"""
strSearchSql = strSearchSql & ", ""DAV:href"""
strSearchSql = strSearchSql & ", ""DAV:displayname"""
strSearchSql = strSearchSql & ", ""DAV:isfolder"""
strSearchSql = strSearchSql & ", ""DAV:iscollection"""
strSearchSql = strSearchSql & " from scope ('shallow traversal of "
& Chr(34)
strSearchSql = strSearchSql & strSourceFolderUrl & """') "
strSearchSql = strSearchSql & " WHERE ""DAV:ishidden"" = false"

ListObjects URL_BASE & "MBX/" & StFolder, strSearchSql
EndOperation
End Sub

Private Sub ListObjects(strURL As String, _
strRestrictSql As String)

Dim Rec As New ADODB.Record
Dim Rst As New ADODB.Recordset
Dim Conn As New ADODB.Connection
AddLog "Listing objects in " & strURL

Conn.Provider = "Exoledb.DataSource"
Conn.Open strURL

Rst.Open strRestrictSql, Conn 'Rec.ActiveConnection ',
adOpenForwardOnly, adLockOptimistic

If Rst.RecordCount = 0 Then
AddLog "No searched objects found!"
Exit Sub
End If

' now found some objects
Rst.MoveFirst
Do While Not Rst.EOF

Dim strObjectUrl As String
Dim strContentClass As String

' retrieve some properties
strObjectUrl = Rst.Fields("DAV:href")
strContentClass =
Rst.Fields("urn:schemas:mailheader:content-class")

Dim Item As Field
If Rst.Fields("DAV:iscollection") = True Then
AddLog "FolderName : " & Rst.Fields("DAV:displayname") &
vbCrLf & vbCrLf
Dim iFolder As New CDO.Folder
iFolder.DataSource.Open strObjectUrl, Conn, adModeRead

For Each Item In iFolder.Fields
Dim st As String
st = Item.name & "="
If IsArray(Item.Value) Or IsObject(Item.Value)
Then
st = st & " can't show the value since its
object or array"
Else
st = st & Item.Value
End If
AddLog st
Next
Else
Select Case strContentClass
Case "urn:content-classes:message"
Dim iMessage As New CDO.Message
iMessage.DataSource.Open strObjectUrl, Conn,
adModeReadWrite

'display some message poperties
AddLog "Message" & vbCrLf & _
"Sender: " & iMessage.From & vbCrLf & _
"Subject: " & iMessage.Subject & vbCrLf & _
"DateReceived: " & iMessage.ReceivedTime & vbCrLf &
vbCrLf

Case "urn:content-classes:task"
Dim iItem As New CDO.Item
iItem.DataSource.Open strObjectUrl, Conn,
adModeReadWrite
Dim TempObject As String
TempObject = iItem.Fields.Item(CdoTask_Owner).Value
MsgBox
 
 
 

Properties of Items such as Task, Journal, Note created on Exchnage server 2000

Post by jay » Sat, 18 Feb 2006 21:01:35

i Henning ,
Thanks for ur reply ..
Here is some part of my code ..

and StFolder is set to the folder path from which the items are to be
queried ..

Private Sub QueryFolder(StFolder As String)
StartOperation "2. Doing List of folders in the mailbox"
AddLog "URL_BASE=" & URL_BASE
Dim strSearchSql As String
Dim strSourceFolderUrl As String
strSourceFolderUrl = ""
strSearchSql = "select "
strSearchSql = strSearchSql & "
""urn:schemas:mailheader:content-class"""
strSearchSql = strSearchSql & ", ""DAV:href"""
strSearchSql = strSearchSql & ", ""DAV:displayname"""
strSearchSql = strSearchSql & ", ""DAV:isfolder"""
strSearchSql = strSearchSql & ", ""DAV:iscollection"""
strSearchSql = strSearchSql & " from scope ('shallow traversal of "
& Chr(34)
strSearchSql = strSearchSql & strSourceFolderUrl & """') "
strSearchSql = strSearchSql & " WHERE ""DAV:ishidden"" = false"

ListObjects URL_BASE & "MBX/" & StFolder, strSearchSql
EndOperation
End Sub

Private Sub ListObjects(strURL As String, _
strRestrictSql As String)

Dim Rec As New ADODB.Record
Dim Rst As New ADODB.Recordset
Dim Conn As New ADODB.Connection
AddLog "Listing objects in " & strURL

Conn.Provider = "Exoledb.DataSource"
Conn.Open strURL

Rst.Open strRestrictSql, Conn 'Rec.ActiveConnection ',
adOpenForwardOnly, adLockOptimistic

If Rst.RecordCount = 0 Then
AddLog "No searched objects found!"
Exit Sub
End If

' now found some objects
Rst.MoveFirst
Do While Not Rst.EOF

Dim strObjectUrl As String
Dim strContentClass As String

' retrieve some properties
strObjectUrl = Rst.Fields("DAV:href")
strContentClass =
Rst.Fields("urn:schemas:mailheader:content-class")

Dim Item As Field
If Rst.Fields("DAV:iscollection") = True Then
AddLog "FolderName : " & Rst.Fields("DAV:displayname") &
vbCrLf & vbCrLf
Dim iFolder As New CDO.Folder
iFolder.DataSource.Open strObjectUrl, Conn, adModeRead

For Each Item In iFolder.Fields
Dim st As String
st = Item.name & "="
If IsArray(Item.Value) Or IsObject(Item.Value)
Then
st = st & " can't show the value since its
object or array"
Else
st = st & Item.Value
End If
AddLog st
Next
Else
Select Case strContentClass
Case "urn:content-classes:message"
Dim iMessage As New CDO.Message
iMessage.DataSource.Open strObjectUrl, Conn,
adModeReadWrite

'display some message poperties
AddLog "Message" & vbCrLf & _
"Sender: " & iMessage.From & vbCrLf & _
"Subject: " & iMessage.Subject & vbCrLf & _
"DateReceived: " & iMessage.ReceivedTime & vbCrLf &
vbCrLf

Case "urn:content-classes:task"
Dim iItem As New CDO.Item
iItem.DataSource.Open strObjectUrl, Conn,
adModeReadWrite
Dim TempObject As String
TempObject = iItem.Fields.Item(CdoTask_Owner).Value
MsgBox
 
 
 

Properties of Items such as Task, Journal, Note created on Exchnage server 2000

Post by jay » Sat, 18 Feb 2006 21:01:38

i Henning ,
Thanks for ur reply ..
Here is some part of my code ..

and StFolder is set to the folder path from which the items are to be
queried ..

Private Sub QueryFolder(StFolder As String)
StartOperation "2. Doing List of folders in the mailbox"
AddLog "URL_BASE=" & URL_BASE
Dim strSearchSql As String
Dim strSourceFolderUrl As String
strSourceFolderUrl = ""
strSearchSql = "select "
strSearchSql = strSearchSql & "
""urn:schemas:mailheader:content-class"""
strSearchSql = strSearchSql & ", ""DAV:href"""
strSearchSql = strSearchSql & ", ""DAV:displayname"""
strSearchSql = strSearchSql & ", ""DAV:isfolder"""
strSearchSql = strSearchSql & ", ""DAV:iscollection"""
strSearchSql = strSearchSql & " from scope ('shallow traversal of "
& Chr(34)
strSearchSql = strSearchSql & strSourceFolderUrl & """') "
strSearchSql = strSearchSql & " WHERE ""DAV:ishidden"" = false"

ListObjects URL_BASE & "MBX/" & StFolder, strSearchSql
EndOperation
End Sub

Private Sub ListObjects(strURL As String, _
strRestrictSql As String)

Dim Rec As New ADODB.Record
Dim Rst As New ADODB.Recordset
Dim Conn As New ADODB.Connection
AddLog "Listing objects in " & strURL

Conn.Provider = "Exoledb.DataSource"
Conn.Open strURL

Rst.Open strRestrictSql, Conn 'Rec.ActiveConnection ',
adOpenForwardOnly, adLockOptimistic

If Rst.RecordCount = 0 Then
AddLog "No searched objects found!"
Exit Sub
End If

' now found some objects
Rst.MoveFirst
Do While Not Rst.EOF

Dim strObjectUrl As String
Dim strContentClass As String

' retrieve some properties
strObjectUrl = Rst.Fields("DAV:href")
strContentClass =
Rst.Fields("urn:schemas:mailheader:content-class")

Dim Item As Field
If Rst.Fields("DAV:iscollection") = True Then
AddLog "FolderName : " & Rst.Fields("DAV:displayname") &
vbCrLf & vbCrLf
Dim iFolder As New CDO.Folder
iFolder.DataSource.Open strObjectUrl, Conn, adModeRead

For Each Item In iFolder.Fields
Dim st As String
st = Item.name & "="
If IsArray(Item.Value) Or IsObject(Item.Value)
Then
st = st & " can't show the value since its
object or array"
Else
st = st & Item.Value
End If
AddLog st
Next
Else
Select Case strContentClass
Case "urn:content-classes:message"
Dim iMessage As New CDO.Message
iMessage.DataSource.Open strObjectUrl, Conn,
adModeReadWrite

'display some message poperties
AddLog "Message" & vbCrLf & _
"Sender: " & iMessage.From & vbCrLf & _
"Subject: " & iMessage.Subject & vbCrLf & _
"DateReceived: " & iMessage.ReceivedTime & vbCrLf &
vbCrLf

Case "urn:content-classes:task"
Dim iItem As New CDO.Item
iItem.DataSource.Open strObjectUrl, Conn,
adModeReadWrite
Dim TempObject As String
TempObject = iItem.Fields.Item(CdoTask_Owner).Value
MsgBox
 
 
 

Properties of Items such as Task, Journal, Note created on Exchnage server 2000

Post by Henning Kr » Sat, 18 Feb 2006 21:19:24

ello,

where is your definition of CdoTask_Owner? I assume this is the property you
can't read?

with ExOleDB, you should be able to get the owner of the task using the
property
http://schemas.microsoft.com/mapi/id/{0320060000000000c000000000000046}/0x811f.

Greetings,
Henning


"jay" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...


 
 
 

Properties of Items such as Task, Journal, Note created on Exchnage server 2000

Post by jay » Sat, 18 Feb 2006 23:21:48

yah i have set that to correct value... and also tried out ur
suggestion but it didnt work out . But this time it did not give me any
error but returned a null string when thr is a owner assinged to this
task item which i can clearly see using Outlook spy . aslo i can see
these properties using Mdbvu32.exe utility but am not getting it how i
can use that information to solve my problem in current VB & CDo code
.. can u suggest some thing ??

Thanks and regards
Jay
 
 
 

Properties of Items such as Task, Journal, Note created on Exchnage server 2000

Post by jay » Sun, 19 Feb 2006 01:11:54

i solved the problem ..
property name was required in this fromat ..

http://www.yqcomputer.com/ ;mapiproptag> e.g. ..
http://www.yqcomputer.com/
now it works perfectly ..

nyway thanks a lot for ur suggestions ...

regards
Jay