| Author |
Message |
gilad
Guest
|
Posted:
Wed Sep 14, 2005 8:59 am Post subject:
CDO, MAPI Translation |
|
|
Hi,
I get a MAPI folder of Public Folder as follows:
Dim g_Session 'As MAPI.Session
Dim g_root 'As MAPI.Folders
g_Session.Logon "", "", False, False, True, True, sServer & vbLf & sCli
Set objInfoStores = g_Session.InfoStores
For Each objInfoStore In objInfoStores
Err.Clear
strRootID = objInfoStore.Fields(&H66310102)
' Check or possible errors
If Err.Number = 0 Then
' Get root folder
Set g_root = g_Session.GetFolder(strRootID,
objInfoStore.ID).Folders
Exit For
End If
Next
Set g_fldr = g_root.Item("My Sub Folder")
till here everything is ok. now I would like to mail enable the folder
as follows:
Dim objFolder As New CDO.Folder
Dim objRecip As CDOEXM.IMailRecipient
Set objRecip = g_fldr
objRecip.MailEnable
objFolder.DataSource.Save
The problem is that objRecip is not the same as g_fldr. Any idea how to
make this work ?
P.S
Opening the folder using backofficestorage, ADO is not working ok on my
computer, maybe ADO dll issues.
Thanks,
Gilad.
|
|
| Back to top |
|
 |
Glen Scales [MVP]
Guest
|
Posted:
Thu Sep 15, 2005 12:59 am Post subject:
Re: CDO, MAPI Translation |
|
|
It looks like you might be getting you CDO's mixed up the code your using to
get the folder is CDO 1.2 which access's the Exchange store over MAPI. The
code from
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_cdo_enabling_a_folder_for_mail.asp
use's CDOEX and CDOEXM. CDOEX uses ADO/Exoledb to access the Exchange store
and hence can only be used locally on an Exchange server. You can't mix CDO
1.2 and CDOEX/CDOEXM code together. To mail enable a folder you need to use
code simular to that example that opens the item using the file or Http URI
(the backofficestorage thing). An alternative to this if you need to make
your code run remotly is if your running Exchange 2003 is that you can now
use WMI to mailenable a folder see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_wmiref_pr_Exchange_PublicFolderIsMailEnabled.asp
and
http://gsexdev.blogspot.com/2005/02/mail-enabling-public-folder-via-wmi.html
..
Cheers
Glen
"gilad" <giladvi@cellcom.co.il> wrote in message
news:1126684861.912409.303500@z14g2000cwz.googlegroups.com...
| Quote: | Hi,
I get a MAPI folder of Public Folder as follows:
Dim g_Session 'As MAPI.Session
Dim g_root 'As MAPI.Folders
g_Session.Logon "", "", False, False, True, True, sServer & vbLf & sCli
Set objInfoStores = g_Session.InfoStores
For Each objInfoStore In objInfoStores
Err.Clear
strRootID = objInfoStore.Fields(&H66310102)
' Check or possible errors
If Err.Number = 0 Then
' Get root folder
Set g_root = g_Session.GetFolder(strRootID,
objInfoStore.ID).Folders
Exit For
End If
Next
Set g_fldr = g_root.Item("My Sub Folder")
till here everything is ok. now I would like to mail enable the folder
as follows:
Dim objFolder As New CDO.Folder
Dim objRecip As CDOEXM.IMailRecipient
Set objRecip = g_fldr
objRecip.MailEnable
objFolder.DataSource.Save
The problem is that objRecip is not the same as g_fldr. Any idea how to
make this work ?
P.S
Opening the folder using backofficestorage, ADO is not working ok on my
computer, maybe ADO dll issues.
Thanks,
Gilad.
|
|
|
| Back to top |
|
 |
gilad
Guest
|
Posted:
Thu Sep 15, 2005 4:59 pm Post subject:
Re: CDO, MAPI Translation |
|
|
Thanks.
Don't know why the backofficestorage thing is working only in my lab,
not production. I have an open case at MS, waiting for an answer. Any
idea ?
The WMI is taking so long, maybe something is not configured well ?
Thanks again.
|
|
| Back to top |
|
 |
Glen Scales [MVP]
Guest
|
Posted:
Fri Sep 16, 2005 8:59 am Post subject:
Re: CDO, MAPI Translation |
|
|
Make sure you are using the correct domain name if you have multiple
recipient policies setup see
http://blogs.technet.com/exchange/archive/2004/04/02/106778.aspx . Have you
tried using the http URI (eg just cut and paste the URL from OWA). The next
place to start looking to see if you have a problem is the event log on the
server you should have an event for the successful startup of Exoledb in
your application event log (from the EXOLEDB source)
Cheers
Glen
"gilad" <giladvi@cellcom.co.il> wrote in message
news:1126787454.806595.4740@g43g2000cwa.googlegroups.com...
| Quote: | Thanks.
Don't know why the backofficestorage thing is working only in my lab,
not production. I have an open case at MS, waiting for an answer. Any
idea ?
The WMI is taking so long, maybe something is not configured well ?
Thanks again.
|
|
|
| Back to top |
|
 |
|
|
|
|