Processing Email Messages in .pst, changing email addresses

Status
Not open for further replies.
A

akumar

I am trying to process .pst files with years or archived email. Many of the

email messages came from backing-up email that I received on Microsoft

Exchange servers.

As a result, many of the messages have Sender, and Recipient email addresses

stored in "EX" format.

I would like to process these .pst files and change the "EX" email addresses

to some "SMTP" like string (and change the type to "SMTP") so that I can

import into gmail.

I can locate the message, I can locate the addresses, BUT all of the

Recipient objects are read-only.

I am not trying to send email as another user, or add other users to a

message; just change the TYPE and Email Address so that the import to GMAIL

(through IMAP) works correctly.

How do I go about doing this.

As a point of reference, here is some code ... Procedure below will

recursively process folders, assume that it is called with some top level

folder. I'm looking for code to stick in the place that has the comment 'Fill

in code here ...

Public Sub ProcessFolder(ByVal pFolder As Outlook.MAPIFolder)

Dim lSubFolderList As Outlook.Folders

Dim lSubFolder As Outlook.MAPIFolder

Dim lItems As Outlook.Items

Dim lItem As Object

Dim lMailItem As Outlook.MailItem

Set lSubFolderList = pFolder.Folders

Set lSubFolder = lSubFolderList.GetFirst

Do While Not lSubFolder Is Nothing

Call ProcessFolder(lSubFolder)

Loop

Set lItems = pFolder.Items

For Each lItem In lItems

If (lItem.Class = olMail) Then

Set lMailItem = lItem

' Fill in code here ...

End If

Next

End Sub
 
You would have to add new recipients with the desired characteristics and

remove the existing ones.

"akumar" <akumar> wrote in message

news:174AEA33-0E09-42E3-BCF7-0A702C708CD5@microsoft.com...
> I am trying to process .pst files with years or archived email. Many of the
> email messages came from backing-up email that I received on Microsoft
> Exchange servers.

> As a result, many of the messages have Sender, and Recipient email
> addresses
> stored in "EX" format.

> I would like to process these .pst files and change the "EX" email
> addresses
> to some "SMTP" like string (and change the type to "SMTP") so that I can
> import into gmail.

> I can locate the message, I can locate the addresses, BUT all of the
> Recipient objects are read-only.

> I am not trying to send email as another user, or add other users to a
> message; just change the TYPE and Email Address so that the import to
> GMAIL
> (through IMAP) works correctly.

> How do I go about doing this.

> As a point of reference, here is some code ... Procedure below will
> recursively process folders, assume that it is called with some top level
> folder. I'm looking for code to stick in the place that has the comment
> 'Fill
> in code here ...

> Public Sub ProcessFolder(ByVal pFolder As Outlook.MAPIFolder)
> Dim lSubFolderList As Outlook.Folders
> Dim lSubFolder As Outlook.MAPIFolder
> Dim lItems As Outlook.Items
> Dim lItem As Object
> Dim lMailItem As Outlook.MailItem

> Set lSubFolderList = pFolder.Folders
> Set lSubFolder = lSubFolderList.GetFirst

> Do While Not lSubFolder Is Nothing
> Call ProcessFolder(lSubFolder)
> Loop

> Set lItems = pFolder.Items
> For Each lItem In lItems
> If (lItem.Class = olMail) Then
> Set lMailItem = lItem
> ' Fill in code here ...

> End If
> Next
> End Sub
>
 
Awesome, I'll use that for To, CC and BCC. Can you help me with the

SenderAddress. I suspect that this technique won't work for SenderAddress.

-ak
wrote:


> You would have to add new recipients with the desired characteristics and
> remove the existing ones.

> >

>

> "akumar" <akumar> wrote in message
> news:174AEA33-0E09-42E3-BCF7-0A702C708CD5@microsoft.com...
> >I am trying to process .pst files with years or archived email. Many of the
> > email messages came from backing-up email that I received on Microsoft
> > Exchange servers.
> > As a result, many of the messages have Sender, and Recipient email
> > addresses
> > stored in "EX" format.
> > I would like to process these .pst files and change the "EX" email
> > addresses
> > to some "SMTP" like string (and change the type to "SMTP") so that I can
> > import into gmail.
> > I can locate the message, I can locate the addresses, BUT all of the
> > Recipient objects are read-only.
> > I am not trying to send email as another user, or add other users to a
> > message; just change the TYPE and Email Address so that the import to
> > GMAIL
> > (through IMAP) works correctly.
> > How do I go about doing this.
> > As a point of reference, here is some code ... Procedure below will
> > recursively process folders, assume that it is called with some top level
> > folder. I'm looking for code to stick in the place that has the comment
> > 'Fill
> > in code here ...
> > Public Sub ProcessFolder(ByVal pFolder As Outlook.MAPIFolder)
> > Dim lSubFolderList As Outlook.Folders
> > Dim lSubFolder As Outlook.MAPIFolder
> > Dim lItems As Outlook.Items
> > Dim lItem As Object
> > Dim lMailItem As Outlook.MailItem
> > Set lSubFolderList = pFolder.Folders
> > Set lSubFolder = lSubFolderList.GetFirst
> > Do While Not lSubFolder Is Nothing
> > Call ProcessFolder(lSubFolder)
> > Loop
> > Set lItems = pFolder.Items
> > For Each lItem In lItems
> > If (lItem.Class = olMail) Then
> > Set lMailItem = lItem
> > ' Fill in code here ...
> > End If
> > Next
> > End Sub
> >


>
 
Do you mean SenderEmailAddress? That's a read-only string property, not much

you can do about that.

"akumar" <akumar> wrote in message

news:6EE6BB29-52BD-4517-8447-D1FEDF6F296E@microsoft.com...
> Awesome, I'll use that for To, CC and BCC. Can you help me with the
> SenderAddress. I suspect that this technique won't work for SenderAddress.

> -ak
 
Well, as it turns out, the suggestion re other recipients was also not

workable. In order to save the changes, I have to call lMailItem.Save which

promptly resets the dates on the message.
wrote:


> Do you mean SenderEmailAddress? That's a read-only string property, not much
> you can do about that.

> >

>

> "akumar" <akumar> wrote in message
> news:6EE6BB29-52BD-4517-8447-D1FEDF6F296E@microsoft.com...
> > Awesome, I'll use that for To, CC and BCC. Can you help me with the
> > SenderAddress. I suspect that this technique won't work for SenderAddress.
> > -ak


>
 
Of course you have to save any changes to make them persistent, and that

will change dates. There's really no way to change an item in any way

without changing various date properties.

"akumar" <akumar> wrote in message

news:4219801E-0FDF-432A-A4C4-D6D266F9FC0B@microsoft.com...
> Well, as it turns out, the suggestion re other recipients was also not
> workable. In order to save the changes, I have to call lMailItem.Save
> which
> promptly resets the dates on the message.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
C Email bomb processing Outlook VBA and Custom Forms 1
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
T "Words In Recipient's Address" Rule Causes Outlook To Stop Processing Rules Using Outlook 3
Peter H Williams How to Move Mail item after processing Outlook VBA and Custom Forms 5
B When I add more search strings to RULES, it is not processing them Using Outlook 3
E Outlook Form - Voting Responses Not Auto Processing If Form Contains Any Code Outlook VBA and Custom Forms 0
A Processing Incoming E-mails with Macros Using Outlook 0
M Outlook 2016 Desktop - Automatic Rule Processing Using Outlook 3
K Outlook 2013 stuck "processing" when opening. Using Outlook 3
E Processing Bounced Emails Outlook VBA and Custom Forms 3
J Data Processing Using Outlook 3
A Pull mail without marking and processing, only by selecting it Using Outlook 1
L VBA Processing of Active E-Mail Message Outlook VBA and Custom Forms 2
J Outlook not processing all incoming emails Outlook VBA and Custom Forms 3
T read receipts while processing emails Outlook VBA and Custom Forms 5
J Auto processing of incoming mail Outlook VBA and Custom Forms 1
J Auto processing of incoming mail Outlook VBA and Custom Forms 1
R Legacy Outlook on Mac Email Cache Using Outlook 0
P Email address auto-completes work fine on laptop, but no longer on desktop Using Outlook 3
S Create Outlook Task from Template and append Body with Email Body Outlook VBA and Custom Forms 4
H Copying email address(es) in body of email and pasting in To field Outlook VBA and Custom Forms 1
A Search folder and move the email Outlook VBA and Custom Forms 0
P VBA to add email address to Outlook 365 rule Outlook VBA and Custom Forms 0
farrissf Outlook 2016 Optimizing Email Searches in Outlook 2016: Seeking Insights on Quick Search vs Advanced Search Features Using Outlook 0
D Delete selected text in outgoing email body Outlook VBA and Custom Forms 0
F Graphics in email / Mac recipient garbled Using Outlook 0
D Outlook VBA forward the selected email to the original sender’s email ID (including the email used in TO, CC Field) from the email chain Outlook VBA and Custom Forms 2
Witzker Outlook 2019 Macro to seach in all contact Folders for marked Email Adress Outlook VBA and Custom Forms 1
E Outlook 365 Save Selected Email Message as .msg File - oMail.Delete not working when SEARCH Outlook VBA and Custom Forms 0
S Email Macros to go to a SHARED Outlook mailbox Draft folder...NOT my personal Outlook Draft folder Using Outlook 2
R Outlook 365 VBA AUTO SEND WITH DELAY FOR EACH EMAIL Outlook VBA and Custom Forms 0
G Print email attachments when hit subfolder Outlook VBA and Custom Forms 1
C Spam Email? Using Outlook 2
G Automatically delete email when a condition is met Outlook VBA and Custom Forms 1
E Save Selected Email Message as .msg File - digitally sign email doesn't works Outlook VBA and Custom Forms 1
S Email was migrated from GoDaddy to Microsoft exchange. We lost IMAP ability Exchange Server Administration 1
R Outlook 365 How to integrate a third-party app with Outlook to track email and sms? Using Outlook 2
S Paperclip icon shows without attachment in email under Sent folder Using Outlook 0
B Outlook 2019 Automatically move email after assigning category Using Outlook 4
Rupert Dragwater How to permanently remove an email address Using Outlook 9
K vba code to auto download email into a specific folder in local hard disk as and when any new email arrives in Inbox/subfolder Outlook VBA and Custom Forms 0
F Auto changing email subject line in bulk Using Outlook 2
F Want to add second email to Outlook for business use Using Outlook 4
kburrows Outlook Email Body Text Disappears/Overlaps, Folders Switch Around when You Hover, Excel Opens Randomly and Runs in the Background - Profile Corrupt? Using Outlook 0
J Outlook 365 Outlook Macro to Sort emails by column "Received" to view the latest email received Outlook VBA and Custom Forms 0
A Outlook 2019 Help with forwarding email without mentioning the previous email sender. Outlook VBA and Custom Forms 0
J Macro to send email as alias Outlook VBA and Custom Forms 0
M Shift Delete doesn't delete email from server Using Outlook 3
K Incorporate selection from combobox into body of email Outlook VBA and Custom Forms 0
L Why are some email automatically going to "archive" Using Outlook 2

Similar threads

Back
Top