|
|
|
date: 17 Feb 2006 03:22:43 -0800,
group: microsoft.public.exchange2000.development
back
Re: Properties of Items such as Task, Journal, Note created on Exchnage server 2000
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
"jay" wrote in message
news:1140175363.428133.314830@g44g2000cwa.googlegroups.com...
> 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
>
date: Fri, 17 Feb 2006 12:31:35 +0100
author: Henning Krause [MVP]
Re: Properties of Items such as Task, Journal, Note created on Exchnage server 2000
Hi 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 TempObject, vbOKOnly
Case Else
AddLog "The case :" & strContentClass & " is not
included here"
End Select
End If 'not folder
Rst.MoveNext
Loop
' close connections
Rst.Close
Conn.Close
'Rec.Close
' clear up
Set Rst = Nothing
Set Conn = Nothing
If Err.Number = 0 Then
AddLog "Good Job!"
End If
End Sub
Let me know if anything is wrong in my code ..and how can i get those
properties using CDO .Do u have any of code examples for the same
Thanks
Jay.
date: 17 Feb 2006 03:56:06 -0800
author: jay
Re: Properties of Items such as Task, Journal, Note created on Exchnage server 2000
Hi 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 TempObject, vbOKOnly
Case Else
AddLog "The case :" & strContentClass & " is not
included here"
End Select
End If 'not folder
Rst.MoveNext
Loop
' close connections
Rst.Close
Conn.Close
'Rec.Close
' clear up
Set Rst = Nothing
Set Conn = Nothing
If Err.Number = 0 Then
AddLog "Good Job!"
End If
End Sub
Let me know if anything is wrong in my code ..and how can i get those
proerties using CDO .Do u have any of code examples for the same
Thnkas
Jay.
date: 17 Feb 2006 04:01:35 -0800
author: jay
Re: Properties of Items such as Task, Journal, Note created on Exchnage server 2000
Hi 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 TempObject, vbOKOnly
Case Else
AddLog "The case :" & strContentClass & " is not
included here"
End Select
End If 'not folder
Rst.MoveNext
Loop
' close connections
Rst.Close
Conn.Close
'Rec.Close
' clear up
Set Rst = Nothing
Set Conn = Nothing
If Err.Number = 0 Then
AddLog "Good Job!"
End If
End Sub
Let me know if anything is wrong in my code ..and how can i get those
properties using CDO .Do u have any of code examples for the same
Thanks
Jay.
date: 17 Feb 2006 04:01:38 -0800
author: jay
Re: Properties of Items such as Task, Journal, Note created on Exchnage server 2000
Hello,
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" wrote in message
news:1140177366.768214.110280@g44g2000cwa.googlegroups.com...
> Hi 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 TempObject, vbOKOnly
>
> Case Else
> AddLog "The case :" & strContentClass & " is not
> included here"
> End Select
>
> End If 'not folder
>
> Rst.MoveNext
> Loop
>
> ' close connections
> Rst.Close
> Conn.Close
> 'Rec.Close
>
> ' clear up
> Set Rst = Nothing
> Set Conn = Nothing
> If Err.Number = 0 Then
> AddLog "Good Job!"
> End If
>
> End Sub
>
>
> Let me know if anything is wrong in my code ..and how can i get those
> properties using CDO .Do u have any of code examples for the same
>
> Thanks
> Jay.
>
date: Fri, 17 Feb 2006 13:19:24 +0100
author: Henning Krause [MVP]
|
|