Processing Email Messages in .pst, changing email addresses

  • Thread starter Thread starter akumar
  • Start date Start date
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 File not found when sending email with attached pdf file Using Outlook 2
U Trouble sending large files to a email group but can to the individuals in that group Using Outlook 8
P Xfinity/Comcast email service stopping sometime in 2025 - warning Using Outlook 5
O Two identical email accounts in Offline Global Address List Using Outlook 2
H Spam email in Gmail not visible in Outlook Using Outlook 3
J Renegade spam URL line displayed in old local Outlook 365 email title Using Outlook 3
L Hide Selected Email Address from Address Book Using Outlook 5
Y QQ on Scheduled Delivery of an Email Using Outlook 0
T Replace Text in Email Subject Outlook VBA and Custom Forms 3
Rupert Dragwater Cannot reestablish gmail (email address) account in Outlook 365 Using Outlook 11
M Outlook 365 adding standard message in body of template email Outlook VBA and Custom Forms 3
E Create Rule to Forward Email if Subject Begins With Using Outlook 2
V iCloud For Windows v15.x - Missing Email Features ? Using Outlook 4
M Thunderbird email client - I wonder Using Outlook 1
D Outlook Desktop App Email Software Using Outlook 0
P Email and calendar entry text now shifts right about 3 tabs worth of space Using Outlook 1
J Outlook macro to run before email is being send Outlook VBA and Custom Forms 3
T Outlook 2010 Creating a email 'Group' in OL 2010 Using Outlook 2
D Send email from Outlook Alias using Mac? Using Outlook 0
T How to set Default FONT for Email composing ? Using Outlook 0
H Finding text in open email Outlook VBA and Custom Forms 12
T Why do Outlook Desktop 2021 tasks from my wife's email show up in my task pane? Using Outlook 2
A Opening a link from an email automatically Outlook VBA and Custom Forms 0
D Outlook 2021 New email reminder Using Outlook.com accounts in Outlook 1
Rupert Dragwater How do I remove an email ending with @gmail.com Using Outlook 4
M A plug in (or method) to keep email message formatting after it expires Using Outlook 1
L VBA to Triage Incoming Email Outlook VBA and Custom Forms 0
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

Similar threads

Back
Top