Deleted Item not in 'deleted' folder?

  • Thread starter Thread starter Peter Ramsebner
  • Start date Start date
P

Peter Ramsebner

Hi all,

when i delete an email item, then it will be moved to the 'deleted' Folder.
But on an other installation not.
Why this?

to delete the items i use: MyItems(i).Delete


Thanks for help

Peter
 
I have used this approach on vb.net+OL2000+PIII 500Mhz . this can soft
delete the items successfully. If there is any way to do the hard
delete for those items?
Also, I have tried to apply this approach to the folder containing 500
items. It took 4 mins to delete them. Is there a faster way to do it?
If the hard delete is available, will it be faster?

Also, I tried to move those item to a temp folder and soft delete that
folder and then do it again in the trash. it is very slow too.

Any suggestion?

Regards,
Tony
 
Using CDO 1.21's Delete or Extended MAPI to delete the items is a hard
delete and is much faster than using the Outlook object model. CDO isn't
officially supported for .NET addins and MAPI requires the use of C++ or
Delphi and has a long learning curve. CDO can be used from .NET but it is an
optional installation for Outlook 2000 and later.

Another alternative is a 3rd party library Redemption
(www.dimastr.com/redemption), which can be used from .NET languages and can
hard delete items also. It would be somewhat slower in that case than CDO
1.21 or pure MAPI but would most likely be faster than using the Outlook
object model.
 
Does CDO need to connect to exchange server? can it connect to
standalone outlook? In my program, I only run standalone outlook.

Regards,
Tony
 
You can use CDO 1.21 with Outlook connecting to a PST file, it doesn't
require connection to an Exchange server.
 
Ken said:
You can use CDO 1.21 with Outlook connecting to a PST file, it doesn't
require connection to an Exchange server.
This method can apply to outlook 2000, outlook xp and outlook 2003?
How about outlook express and outlook 97?

Regards,
Tony
 
Ken said:
You can use CDO 1.21 with Outlook connecting to a PST file, it doesn't
require connection to an Exchange server.
I have tried

CreateObject("MAPI.Session")

However, I got the error

Either there is no default mail client or the current mail client cannot
fulfill the messaging request. Please run Microsoft Outlook and set it
as the default mail client.

I don't want to make outlook as default mail client, because not all
people want to do so. But how can I connect to PST file if I want to
access to outlook's contacts and delete them if I need.

Regards,
Tony
 
First if you are going to use CDO 1.21 you have to make sure it's installed.
It's an optional installation for Outlook 2000 and later.

Second, if Outlook is running you can use what's called a piggy-back logon
to the Outlook session. If Outlook is not running you would need to log into
a CDO session using the profile information for the Outlook profile you want
to use. If the user is working with Outlook 98 or 2000 in Internet only mode
you may have problems since the MAPI there is limited.

If Outlook is not the default mail handler you can still use CDO 1.21 but
you have to know all the details of logging into a profile that will access
the PST file you want.
 
Again, you will get errors trying to instantiate a MAPI.Session if CDO 1.21
is not installed. It's optional and often is not installed.

There are many examples of various logons using CDO 1.21 at
www.cdolive.com/cdo5.htm.

A piggy-back logon won't do you any good at all if Outlook isn't running.
Here's an example of that:
Dim oCDO As MAPI.Session
Set oCDO = CreateObject("MAPI.Session")
oCDO.Logon "", "", False, False

For a logon using profile information you will need to know the mailbox and
server names and have a Windows logon with permissions on that mailbox. Then
you can use something like this:
Dim oCDO As MAPI.Session
Dim strProfileInfo As String
Set oCDO = CreateObject("MAPI.Session")
strProfileInfo = "<Your Servername>" & vbLf & "<Your Mailbox>"
oCDO.Logon "", "", False, True, 0, False, strProfileInfo

Or you can use the profile name if you know it:
oCDO.Logon "<Profile Name>", "", False, True, 0

Profile names can be found under HKCU\Software\Microsoft\Windows
NT\CurrentVersion\Windows Messaging Subsystem\Profiles. The default profile
is listed in a string value in that key named DefaultProfile.
 
Ken said:
First if you are going to use CDO 1.21 you have to make sure it's installed.
It's an optional installation for Outlook 2000 and later.

Second, if Outlook is running you can use what's called a piggy-back logon
to the Outlook session. If Outlook is not running you would need to log into
a CDO session using the profile information for the Outlook profile you want
to use. If the user is working with Outlook 98 or 2000 in Internet only mode
you may have problems since the MAPI there is limited.
Do you have any example on how to do the piggy-back logon and how to
find the outlook profile available in the local machine? from the logon
parameters... there are many many need to be input, but I don't know
where to find those information for the current login user.
If Outlook is not the default mail handler you can still use CDO 1.21 but
you have to know all the details of logging into a profile that will access
the PST file you want.
Do you know where to find those details for logging into the profile?
when I do the call "new MAPI.session" , the warning window popup
immediately. Do you have any example about this issue?

Regards,
Tony
 
Back
Top