A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Received date empty



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 16th 09, 05:44 AM posted to microsoft.public.outlook.program_vba
Marc[_7_]
external usenet poster
 
Posts: 19
Default Received date empty


Created an Outlook mail item programmatically
and sent it by using Redemption safemailitem.
Next I created a new folder in Personal Folders
and dragged and dropped that sent mail item in to that
new folder from Sent Items folder.
Then I checked the Received date value of the mail,
that is empty. This is my VFP code to send mails.
Pls someone help..

poOutlook = CREATEOBJECT("Outlook.Application")
loOutBox = poOutlook.GetNameSpace("MAPI").GetDefaultFolder(4)
loRedemption = CREATEOBJECT("Redemption.SafeMailItem")
loOutBox = poOutlook.GetNameSpace("MAPI").GetDefaultFolder(4)
loRedemption.Item = toOutBox.Items.Add(0)
loEmailItem = loRedemption
loEmailItem.To = "
loEmailItem.Subject = "Test received date "+TTOC(DATETIME())
loEmailItem.BodyFormat = 1
loEmailItem.Body = "Test received date"
loOutBoxMailItem = loEmailItem.Move(loOutBox)
loMailItem = CREATEOBJECT("Redemption.SafeMailItem")
loMailItem.Item = loOutBoxMailItem
loMailItem.Send()


  #2  
Old September 16th 09, 02:47 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Received date empty

I fail to understand the logic of what you're doing.

You are creating an email item in the Outbox, which is usually something not
done, assigning it to a SafeMailItem, moving the SafeMailItem to the same
folder it's already in as a different SafeMailItem, creating yet another
SafeMailItem, assigning that from the superfluous SafeMailItem you just
created, and then sending that final item.

Is there a reason for all this pretzel logic?

Why not just follow the KISS principle:

poOutlook = CREATEOBJECT("Outlook.Application")

loMail = poOutlook.CreateItem(0)
loMail.To = "
loMail.Subject = "Test received date "+TTOC(DATETIME())
loMail.BodyFormat = 1
loMail.Body = "Test received date"

loRedemption = CREATEOBJECT("Redemption.SafeMailItem")
loRedemption.Item = loMail
loRedemption.Send()

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Marc" wrote in message
...

Created an Outlook mail item programmatically
and sent it by using Redemption safemailitem.
Next I created a new folder in Personal Folders
and dragged and dropped that sent mail item in to that
new folder from Sent Items folder.
Then I checked the Received date value of the mail,
that is empty. This is my VFP code to send mails.
Pls someone help..

poOutlook = CREATEOBJECT("Outlook.Application")
loOutBox = poOutlook.GetNameSpace("MAPI").GetDefaultFolder(4)
loRedemption = CREATEOBJECT("Redemption.SafeMailItem")
loOutBox = poOutlook.GetNameSpace("MAPI").GetDefaultFolder(4)
loRedemption.Item = toOutBox.Items.Add(0)
loEmailItem = loRedemption
loEmailItem.To = "
loEmailItem.Subject = "Test received date "+TTOC(DATETIME())
loEmailItem.BodyFormat = 1
loEmailItem.Body = "Test received date"
loOutBoxMailItem = loEmailItem.Move(loOutBox)
loMailItem = CREATEOBJECT("Redemption.SafeMailItem")
loMailItem.Item = loOutBoxMailItem
loMailItem.Send()


  #3  
Old September 17th 09, 03:15 AM posted to microsoft.public.outlook.program_vba
Marc[_7_]
external usenet poster
 
Posts: 19
Default Received date empty

Thanks Ken,
According to your code the mail store in Drafts
folder until it send. But I want to move that mail item
in to my Outbox and send.

"Ken Slovak - [MVP - Outlook]" wrote in message
...
I fail to understand the logic of what you're doing.

You are creating an email item in the Outbox, which is usually something
not
done, assigning it to a SafeMailItem, moving the SafeMailItem to the same
folder it's already in as a different SafeMailItem, creating yet another
SafeMailItem, assigning that from the superfluous SafeMailItem you just
created, and then sending that final item.

Is there a reason for all this pretzel logic?

Why not just follow the KISS principle:

poOutlook = CREATEOBJECT("Outlook.Application")

loMail = poOutlook.CreateItem(0)
loMail.To = "
loMail.Subject = "Test received date "+TTOC(DATETIME())
loMail.BodyFormat = 1
loMail.Body = "Test received date"

loRedemption = CREATEOBJECT("Redemption.SafeMailItem")
loRedemption.Item = loMail
loRedemption.Send()

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Marc" wrote in message
...

Created an Outlook mail item programmatically
and sent it by using Redemption safemailitem.
Next I created a new folder in Personal Folders
and dragged and dropped that sent mail item in to that
new folder from Sent Items folder.
Then I checked the Received date value of the mail,
that is empty. This is my VFP code to send mails.
Pls someone help..

poOutlook = CREATEOBJECT("Outlook.Application")
loOutBox = poOutlook.GetNameSpace("MAPI").GetDefaultFolder(4)
loRedemption = CREATEOBJECT("Redemption.SafeMailItem")
loOutBox = poOutlook.GetNameSpace("MAPI").GetDefaultFolder(4)
loRedemption.Item = toOutBox.Items.Add(0)
loEmailItem = loRedemption
loEmailItem.To = "
loEmailItem.Subject = "Test received date "+TTOC(DATETIME())
loEmailItem.BodyFormat = 1
loEmailItem.Body = "Test received date"
loOutBoxMailItem = loEmailItem.Move(loOutBox)
loMailItem = CREATEOBJECT("Redemption.SafeMailItem")
loMailItem.Item = loOutBoxMailItem
loMailItem.Send()




  #4  
Old September 17th 09, 03:42 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Received date empty

That's just cosmetic, but if that's what you want just add a line to move
the item to Outbox before calling Send on that referenced moved item.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Marc" wrote in message
...
Thanks Ken,
According to your code the mail store in Drafts
folder until it send. But I want to move that mail item
in to my Outbox and send.


  #5  
Old September 30th 09, 05:05 PM posted to microsoft.public.outlook.program_vba
Gianluca Vannozzi
external usenet poster
 
Posts: 1
Default Received date empty



"Ken Slovak - [MVP - Outlook]" wrote:

That's just cosmetic, but if that's what you want just add a line to move
the item to Outbox before calling Send on that referenced moved item.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Marc" wrote in message
...
Thanks Ken,
According to your code the mail store in Drafts
folder until it send. But I want to move that mail item
in to my Outbox and send.




Hi, can i ask you to post just few lines to move it to SentItems ?
Thank you very much.
  #6  
Old September 30th 09, 05:40 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Received date empty

Replace the line

loRedemption.Item = toOutBox.Items.Add(0)

with

loOutlookItem = poOutlook.CreateItem(0)
loOutlookItem = loOutlookItem .Move(loOutBox )
loRedemption.Item = loOutlookItem

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Gianluca Vannozzi" Gianluca wrote in
message ...


"Ken Slovak - [MVP - Outlook]" wrote:

That's just cosmetic, but if that's what you want just add a line to move
the item to Outbox before calling Send on that referenced moved item.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Marc" wrote in message
...
Thanks Ken,
According to your code the mail store in Drafts
folder until it send. But I want to move that mail item
in to my Outbox and send.




Hi, can i ask you to post just few lines to move it to SentItems ?
Thank you very much.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Manually change 'Date Sent', 'Date received' in messages ... how ? baxe0 Outlook and VBA 2 September 15th 15 01:02 PM
Manually change 'Date Sent', 'Date received' in messages ... how ? baxe0 Outlook - Using Forms 0 March 21st 07 02:46 PM
Calcualting the time between email received date and reply date Shanks Outlook - General Queries 3 February 22nd 07 03:11 AM
Incorrect Date showing as Received Date Sean Outlook - General Queries 0 December 27th 06 09:05 AM
Exporting Date received and Date Sent to Access Sugarthebeet Outlook - General Queries 1 January 19th 06 08:06 PM


All times are GMT +1. The time now is 09:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.