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
 
K

Ken Slovak - [MVP - Outlook]

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
>
 
A

akumar

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
> >


>
 
K

Ken Slovak - [MVP - Outlook]

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
 
A

akumar

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


>
 
K

Ken Slovak - [MVP - Outlook]

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
V Can one change the formatting of email title blocks? Using Outlook 0
P default font when sending email from browser Using Outlook 1
D VBA Macro to Print and Save email to network location Outlook VBA and Custom Forms 1
B IMAP server rejects sent email - cannot deliver messages Using Outlook 2
TedSch Small vba to kill political email Outlook VBA and Custom Forms 3
X Open Hyperlinks in an Outlook Email Message (Help with Diane's solution) Outlook VBA and Custom Forms 3
e_a_g_l_e_p_i Email notifications changed with Outlook 2021 Using Outlook 8
glnz How to retrieve or redo Verizon.net email password without affecting Outlook connection? Using Outlook 1
Z Copy specific email body text Outlook VBA and Custom Forms 0
D ISOmacro to extract active mail senders name and email, CC, Subject line, and filename of attachments and import them into premade excel spread sheet Outlook VBA and Custom Forms 2
M Outlook 365 refuses to send email Using Outlook 1
B Search and Find Email by Folder Name Outlook VBA and Custom Forms 2
K Closing external IMAP email... Outlook 2013 Using Outlook 0
L Capture email addresses and create a comma separated list Outlook VBA and Custom Forms 5
O What would be the recommended way to change an email address (family member)? Using Outlook 0
A Outlook 2016 Macro to Reply, ReplyAll, or Forward(but with composing new email) Outlook VBA and Custom Forms 0
L Checking Sender Email Address for trusted domain from list on intranet Outlook VBA and Custom Forms 4
J How do you disable address search box when typing @ in body of email? Using Outlook 0
S HTML Code Embedded in String Within Open Outlook Email Preventing Replace(Application.ActiveInspector.CurrentItem.HTMLBody From Working Outlook VBA and Custom Forms 4
Victor.Ayala Automated way to check the option "Show this folder as an email Address Book" Outlook VBA and Custom Forms 2
D Wrong email address in Outlook 2003 "From" tab in new outgoing emails Using Outlook 4
D Forwarding email based on the attachment file type and specific text found on the attachment file name Outlook VBA and Custom Forms 1
F Forward incoming email with 4 embedded images in the body without original sender Outlook VBA and Custom Forms 22
W Macro to Filter Based on Latest Email Outlook VBA and Custom Forms 6
D Create advanced search (email) via VBA with LONG QUERY (>1024 char) Outlook VBA and Custom Forms 2
G Place jpg in body of email Outlook VBA and Custom Forms 1
F Wishlist Outlook suddenly began synchronizing deleted items every time I delete a single email. Using Outlook 2
N Save Selected Email Message as .msg File Outlook VBA and Custom Forms 12
HarvMan Toggle between calendar and email in Outlook 365 Using Outlook 12
F Email being marked as Spam by Gmail and not being visible in Outlook Using Outlook 5
G Email time stamp Using Outlook 2
G Schedule recurring email and attachments display Outlook VBA and Custom Forms 3
G Save and Rename Outlook Email Attachments Outlook VBA and Custom Forms 0

Similar threads

Top