Outlook 2007 - Email Question - POP3 to IMAP

Status
Not open for further replies.

Rowdy

Member
Outlook version
Outlook 2007
Email Account
POP3
Hi,

I recently set up aol account with Outlook and by accident set it for POP3 so it deleted all 24000 emails on the server and downloaded to my computer. I tried to change it to IMAP but it doesn't let me, so I created a new IMAP account and have been dragging all the emails to the new account but it keeps freezing up and not transferring all of them. Is there an easier way because now my email on aol is all messed up.

Also - Outlook renamed a lot of emails to have [SPAM]: in the subject line and the emails transferred back to aol now say [SPAM]: and more of those emails are being sent to my spam folder even new incoming ones. I need a VBA macro to remove this string from a couple thousand emails and delete leading spaces. I can't seem to get any macro to work (even after disabling security). Please assist.

Thanks
Rowdy
 

Forum Admin

Senior Member
Outlook didn't add the spam tag - an antispam addin did. (Assuming AOL didn't.) A macro to fix it is here -
http://www.slipstick.com/outlook/email/add-a-file-number-or-keyword-to-the-subject-line-of-messages/

Replace the 3 lines beginning with For each with the following - it runs on all messages in the selected folder - i recommend testing it on a folder with few messages so you are sure its calculating the correct subject length. Create a new folder and copy a few messages to it.



For Each aItem In mail.Items

' use the exact same text, including case
if instr(1, aitem.subject, "[Spam]") > 0 then

' replace 7 with the correct length, including spaces
strTemp = right(aItem.Subject, len(aitem.subject) -7)
aItem.Subject = strTemp

'rest of macro

End if

How many messages are you moving at once? Any sync error messages?

(Updated Sept 27 to fix problem Michael mentioned.)



Sent from my Venue 8 Pro 5830 using Tapatalk
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
if instr(1, aitem.subject, "[Spam]") > 0 then
For Each aItem In mail.Items

Assuming aItem is valid, that is set to an item in the folder, the above checks for "spam" in one item, then replaces the subject for all items no matter whether or not "spam" is contained. If that's not intended, the lines need to be switched.
 

Rowdy

Member
Outlook version
Outlook 2007
Email Account
POP3
Ok, I managed to finish moving all messages to the IMAP account, but now think I messed up the .pst file when I was trying to change the name of the email account because it had a (1) in it so now outlook just freezes everytime I open it. I'm going to try to go into safe mode to rename it back later today but how would I get rid of the bad name?

As for the VBA code to remove spam, I can't get the code to work.

Sub AddFileNumber() Dim myolApp As Outlook.Application Dim aItem As Object
Set myolApp = CreateObject("Outlook.Application") Set mail = myolApp.ActiveExplorer.CurrentFolder
Dim iItemsUpdated As Integer Dim strTemp As String Dim strFilenum As String

strFilenum = InputBox("Enter the file number")
iItemsUpdated = 0
if instr(1, aitem.subject, "[Spam]") > 0 then
For Each aItem In mail.Items
strTemp = right(aItem.Subject, len(aitem.subject) -8)
aItem.Subject = strTemp
aItem.Save Next aItem

MsgBox iItemsUpdated & " of " & mail.Items.Count & " Messages Updated" Set myolApp = Nothing End Sub
 

Rowdy

Member
Outlook version
Outlook 2007
Email Account
POP3
Macro keeps giving me a compile error with every line.
 

Rowdy

Member
Outlook version
Outlook 2007
Email Account
POP3
Now I'm getting Runtime Error 91 with:

If InStr(1, aItem.Subject, "[Spam]:") > 0 Then
 

Rowdy

Member
Outlook version
Outlook 2007
Email Account
POP3
Sub AddFileNumber()

Dim myolApp As Outlook.Application
Dim aItem As Object
Set myolApp = CreateObject("Outlook.Application")
Set mail = myolApp.ActiveExplorer.CurrentFolder
Dim iItemsUpdated As Integer
Dim strTemp As String

iItemsUpdated = 0
If InStr(1, aItem.Subject, "[Spam]:") > 0 Then
For Each aItem In mail.Items
strTemp = Right(aItem.Subject, Len(aItem.Subject) - 8)
aItem.Subject = strTemp
aItem.Save
Next aItem
Set myolApp = Nothing

End If

End Sub
 

Rowdy

Member
Outlook version
Outlook 2007
Email Account
POP3
Upon swapping those lines I get a compile error: Next without For.

Sub AddFileNumber()
Dim myolApp As Outlook.Application
Dim aItem As Object
Set myolApp = CreateObject("Outlook.Application")
Set mail = myolApp.ActiveExplorer.CurrentFolder
Dim iItemsUpdated As Integer
Dim strTemp As String
iItemsUpdated = 0
For Each aItem In mail.Items
If InStr(1, aItem.Subject, "[Spam]:") > 0 Then
strTemp = Right(aItem.Subject, Len(aItem.Subject) - 8)
aItem.Subject = strTemp
aItem.Save
Next aItem '<<<<<<<<---------
Set myolApp = Nothing
End If
End Sub
 

Rowdy

Member
Outlook version
Outlook 2007
Email Account
POP3
I fixed the problem, had part of the if then statement out of the loop. THANKS SO MUCH!
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S Outlook 2007 printing wrong email address at top of page Using Outlook 8
D Outlook 2007 crashes when opening an email Using Outlook 2
M Outlook 2007 Contacts Glitch: Creating a new email Using Outlook 1
P Outlook 2007 Email Categorization using VBA Outlook VBA and Custom Forms 1
L Outlook 2007 Delete Email Addresses Using Outlook 19
Z Outlook 2007, clicking email addresses fails to open Contact Using Outlook 0
S Send email from excel based on a condition (outlook 2007) Outlook VBA and Custom Forms 1
divan Outlook 2007 - Replace email body with custom text Using Outlook 9
S Can't send messages using Outlook 2007 from a business email Using Outlook 3
L Outlook 2007 Copy Email Address in To Field Using Outlook 11
V Configuring a new IMAP email account in Outlook 2007 Using Outlook 4
S Pre populate subject + body + attachment to already open email in outlook 2007 Using Outlook 2
S unable to send email from my second address (outlook 2007) Using Outlook 2
B Problemss when changing from pop3 to imap email accounts in Outlook 2007 Using Outlook 2
P Changing all email signatures (font, color) at once in outlook 2007 Using Outlook 2
G How to make your IMAP email your default data account in Outlook 2007 Using Outlook 17
B Outlook 2007 - How to set the "send from diff email" as default? Using Outlook 5
M Outlook 2007 cant send email with vista Home Premium Using Outlook 8
L Opening up Contact from an Email - Outlook 2007 Using Outlook 15
A outlook 2007 - there is no email program associated ... Using Outlook 3
L Outlook 2007 Macro to Email Field Using Outlook 31
B Fonts cut off when composing new email on outlook 2007 Using Outlook 1
D Windows 7 / Outlook 2007 - email gets stuck in Outbox Using Outlook 2
I Send Secure Email Through Microsoft Outlook 2007 and 2010 (32 bit) Using Outlook 0
I Send Secure Email Through Microsoft Outlook 2007 and 2010 (32 bit) Using Outlook 0
Z Missing email accounts even though they show in my Outlook 2007 profile Using Outlook 3
R Outlook 2007 - drag drop email to Explorer Using Outlook 1
M Unable to send email to gmail - using Outlook 2007 Using Outlook 3
E Double clicking on from email address does no longer open corresponding contact in Outlook 2007 Using Outlook 7
H Accidentally Deleted exchange server email account in Outlook 2007 Exchange Server Administration 12
S transfer email account settings from Outlook 2007 to 2010 Using Outlook 5
S System Administrator email undeliverable to following recipients Outlook 2007 Using Outlook 4
S Sending Email from Access 2007 through Outlook 2007 using template Outlook VBA and Custom Forms 13
N Outlook 2007 w/BCM - Email issues BCM (Business Contact Manager) 5
N Email issues since installing BCM with Outlook 2007 BCM (Business Contact Manager) 1
S Record eMail details in Outlook 2007 Outlook VBA and Custom Forms 5
B outlook 2007 and Winzip email companion Outlook VBA and Custom Forms 9
T Outlook 2007 Email Form Outlook VBA and Custom Forms 8
J outlook 2007 doesn't let me choose which .pst to search Using Outlook 1
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
S Verwendung von Outlook 2007 Using Outlook 0
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
S outlook 2007 calendar search Using Outlook 6
B Migrate Outlook 2007 to Office 365 Using Outlook 3
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
R Outlook 2007 only loads some appointments Using Outlook 0
C Move Outlook 2007 to new PC with Outlook 365 Using Outlook 3

Similar threads

Top