CDO exchange vb6 outlook

K

Ken

Hi,
Im having trouble moving messages from one public folder to another.
Whenever I use the MoveTo method the message just gets moved back into
the same folder. If I try CopyTo it makes another copy of the message
in the same folder.

Obviously, I have checked the logical things such as ensuring that the
folderId is correct and does not correspond to the source folder. I
have also tried the MoveTo, CopyTo methods with and without the
storeID.

I am sure that this problem is to do with using the right profile.
How do I create a profile. I always thought that a profile was a
windows account. It isnt. How do I create one and then give it the
right permissions?

How can I use CDO without having to have Outlook installed on the
server?

How can I stop that annoying "A program is trying to acess e-mail
addresses you have stored in outlook. Do you want to allow this....."
dialog box.

My Code:

Set oFolderOut = oMapi.GetFolder(m_sProcessedPath)
Set oMessage = oMessage.MoveTo(oFolderOut.FolderID,
oFolderOut.StoreID)
oMessage.Update True, True


Failing all this. Does anyone know whether its possible to just set up
a rule in Olook to save the email to disk? This way I wont have to use
this horrible software they call MS Office.

Failing all of that, does anyone know a really tall building whose top
floor windows are NOT locked so I can end this miserable Microsoft
afflicted life.
 
S

Sue Mosher [MVP]

Comments inline.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Im having trouble moving messages from one public folder to another.
Whenever I use the MoveTo method the message just gets moved back into
the same folder. If I try CopyTo it makes another copy of the message
in the same folder.

Obviously, I have checked the logical things such as ensuring that the
folderId is correct and does not correspond to the source folder. I
have also tried the MoveTo, CopyTo methods with and without the
storeID.
My Code:

Set oFolderOut = oMapi.GetFolder(m_sProcessedPath)
Set oMessage = oMessage.MoveTo(oFolderOut.FolderID,
oFolderOut.StoreID)
oMessage.Update True, True

I think the problem is that you're reusing the variable. Try using a
different object variable:

Set oMovedMessage = oMessage.MoveTo(oFolderOut.FolderID, oFolderOut.StoreID)
I am sure that this problem is to do with using the right profile.
How do I create a profile. I always thought that a profile was a
windows account. It isnt. How do I create one and then give it the
right permissions?

In the context of Outlook programming, "profile" refers to the Outlook mail
profile set up in Control Panel | Mail. CDO also supports dynamic profiles
that use just the server name and mailbox alias; you can read up on them in
the Help for the Session.Logon method. (see
http://www.slipstick.com/dev/cdo.htm if you don't already have the docs.)
How can I use CDO without having to have Outlook installed on the
server?

Outlook is not required. A MAPI profile is. There is an article in the MSKB
on generating a profile without Outlook. but I can't lay my hands on it
right now.

A little context might be helpful. Exactly what is it that you're trying to
do with your application? Why is it a server instead of client application?
How can I stop that annoying "A program is trying to acess e-mail
addresses you have stored in outlook. Do you want to allow this....."
dialog box.

See http://www.slipstick.com/outlook/esecup.htm#autosec for your options.
Failing all this. Does anyone know whether its possible to just set up
a rule in Olook to save the email to disk? This way I wont have to use
this horrible software they call MS Office.

No, but third-party tools can. See
http://www.slipstick.com/addins/housekeeping.htm and
http://www.slipstick.com/addins/auto.htm
 
K

Ken

Thanks a lot Sue. Thank you for all the links they are indeed very
helpful. I resolved both issues using the redemption library.
http://www.dimastr.com/redemption/

The redemption thing is just to overcome the security dialog box. But
I used it to move objects as well.

Im not sure what the problem was /is Its not something I have a lot of
time to try and find out. Its hard explaining to your boss that it
took 5 odd hours trying to add the from field to the database.

Another instance of Microsoft being complete $^%$"£)%*£$"!

Nice security patch idiots! People are still writing viruses that go
through your address book and even regular microsoft devlrs can get
round your silly dialog box....it just takes us normal folk 5 hours to
work it out. I wish I was as clever as the d*$k who Ok'd that stupid
idea.
 
S

Sue Mosher [MVP]

Actually, none of the prominent recent viruses use the Outlook address book.
They harvest from the Windows Address Book (OE) and files on the infected
system. The enhanced security in Outlook has done its job in that regard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top