I have problem with change the sent property of mail, because the property is read-only and I need to change it from the level of vba.
The problem appears after sent the mail from a shared mailbox (using online outlook mode). The mail doesn't go to folder "sent items" in shared mailbox but stay in outbox folder. I have made macro to move the mail to correct folder and everything is fine but the mail have status unsent (when you open the mailitem you are in editing mode). I can't find any solution for the problem.
This is the outbox folder with correctly sent mail and mail sent from shared mailbox:
I resolved the problem with not very tidy way. I changed the registry key DelegateSentItemsStyle to 0 and when I did it, the sent mails went to my personal sent Items folder. Then I just move the mails to shared mailbox.
Related
I'm using Excel VBA to stage emails in Outlook and it is working well.
Dim template As Outlook.MailItem, tomerge As Outlook.MailItem
' Create E-mail
tomerge.Close olSave
The e-mails can then be manually moved to the Drafts folder and sent using this Sub.
'Loop through items in Drafts folder
objDrafts.Item(i).Send
However, many users have a bunch of extra drafts in their Drafts folder that they don't want sent.
If I replace "olFolderDrafts" with "olFolderOutbox" and try to send from their Outbox. The first message sends and then I get a "Run-time error" "Outlook has already begun transmitting this message".
Is there some way to send all from the Outbox or even better is there someway to stage and send from a newly created folder?
You need to create a folder for your unsent items and process them separately. As a rule the Outbox folder contains already submitted items. So, that's not a right place for your items.
The Outlook Object Model provides the Add function of the Folders class. You can get an instance of the Folders class using the Folders property of the Folder class in Outlook. You can read more about that in the How To: Create a new folder in Outlook article.
This answer was inspired by Nagarajan's comment above, but there are quite a few changes necessary from the answer in Send/Receive in Outlook Via Code. The main problem is using olSave doesn't put the messages in a "ready to send" state in Outlook so starting a sync using syc.Start from the answer above does nothing.
Instead, we found the following process to be straight forward:
Put Outlook in offline mode using "Send/Recieve" -> "Work Offline"
Use Excel VBA to stage the e-mails and instead of saving just .Send each email. As Outlook is offline they will be staged and ready to be sent but not actually sent.
The e-mails should now be staged in Outlook's Outbox folder and can be reviewed just be sure to press the "send" button after reviewing/editing messages otherwise the e-mail you modified will be removed from the queue.
When the messages are ready to be sent put Outlook back in online mode and they will be sent automatically.
When I double-click and open any mail in Outlook 2013, there is an option to Edit the message in "Actions".
When I edit the message and save it, Outlook creates 1 more mail item.
Now, there are 2 mail items in Inbox.
Why does Outlook create another mail?
It happens the same if I save the mail item programmatically.
Is there a way I can find out which is the newly mail item and then delete the same?
Challenge description
I'd like to extract the header information from emails in an Outlook folder.
This works so far.
But there are Emails which where scanned by Spamassassin and found as being SPAM. So the SPAM Mail is attached to a new mail as Mail-Attachment.
Now i'd like to extract the header information from the original email-header.
What I already have
I am getting the header information from the 'normal'- mail and can access the Outlook-mail-item and also found the attachement.
What I look for
The easiest way to get the attachment as Outlook-mail-item so that I can perform the getHeader-operation operation. And, if possible without the need to open the attached mail.
Is there a way from the olmailItem to the attached mail (.msg-file) without opeining the attachment?
(Manually - with opening the mail - this can be done by opening the attached mail and look at the message options.)
Outlook does not let you directly access embedded message attachments. The best you can do is call Attachment.SaveAsFile to save the embedded message attachment as an MSG file, then open it using Application.Session.OpenSharedItem.
If you using Redemption is an option (I am its author), it exposes EmbeddedMsg property on both the Attachment object (returned by the SafeMailItem object) and RDOAttachment object (returned by the RDOMail object).
Outlook has an habit of opening sub-folders if an email has been sent to it automatically (through rules). There is no way to turn off this feature.
Does anyone have ideas for code that would periodically (say every 30 seconds), automatically collapse all subfolders within, say, the sent items folder?
Thx
The Outlook object model doesn't provide anything for collapsing folders in the navigation pane.
The Starting Outlook with all folders collapsed/expanded states the following:
To keep the mailbox collapsed even when a new message is being delivered, make sure that your Inbox and other folders that receive email (for instance by a rule) have been added to your Favorites list.
I'm having some trouble making a plugin that will send an email using the users settings without having the item go to Sent Items. I thought I could simply grab the EntryId before sending it and then dlete it from the sent items and deleted folder restricted by that entryID but the problem is that after using mailItem.Send the mail gets sent to the outbox.
I tried looping and rechecking the sent items folder but the email doesn't seem to leave the outbox while this looping is going on.
Does anyone have any suggestions for getting around this?
All you need to do is set the MailItem.DeleteAfterSubmit property to true.