Mark Scholes
Member
- Outlook version
- Outlook 2013 32 bit
- Email Account
- Office 365 Exchange
Hi,
I am using outlook 2013 (32 bit) and I have this piece of code in my Excel spread sheet. It finds a e-mail in a folder opens it and extracts the spread sheet. The part of the code which finds the folder now doesn't work, it did work in outlook 2010 (32Bit)
Set mynamespace = Outlook.Application.GetNamespace("MAPI")
' Set the Source to the mail Inbox folder for AFMA Green data
' Set the Target to the mail sub folder for archiveing
Set SourceFolder = mynamespace.Folders("Risk Quantitative")
' Find the Inbox
iLoopcounter = 1
Do Until iLoopcounter > SourceFolder.Folders.Count
If SourceFolder.Folders(iLoopcounter) = "Inbox" Then
Set SourceFolder = SourceFolder.Folders(iLoopcounter)
Exit Do
End If
iLoopcounter = iLoopcounter + 1
Loop
When you run ? SourceFolder.Folders.count you should get 13, I now only get 0 and so the next piece of code fails
' Find AFMA Green
iLoopcounter = 1
Do Until iLoopcounter > SourceFolder.Folders.Count
If SourceFolder.Folders(iLoopcounter) = "AFMA Green" Then
Set SourceFolder = SourceFolder.Folders(iLoopcounter)
Exit Do
End If
iLoopcounter = iLoopcounter + 1
Loop
To add to the problem I have Four mailboxes
Any thought would be great
Mark Scholes
I am using outlook 2013 (32 bit) and I have this piece of code in my Excel spread sheet. It finds a e-mail in a folder opens it and extracts the spread sheet. The part of the code which finds the folder now doesn't work, it did work in outlook 2010 (32Bit)
Set mynamespace = Outlook.Application.GetNamespace("MAPI")
' Set the Source to the mail Inbox folder for AFMA Green data
' Set the Target to the mail sub folder for archiveing
Set SourceFolder = mynamespace.Folders("Risk Quantitative")
' Find the Inbox
iLoopcounter = 1
Do Until iLoopcounter > SourceFolder.Folders.Count
If SourceFolder.Folders(iLoopcounter) = "Inbox" Then
Set SourceFolder = SourceFolder.Folders(iLoopcounter)
Exit Do
End If
iLoopcounter = iLoopcounter + 1
Loop
When you run ? SourceFolder.Folders.count you should get 13, I now only get 0 and so the next piece of code fails
' Find AFMA Green
iLoopcounter = 1
Do Until iLoopcounter > SourceFolder.Folders.Count
If SourceFolder.Folders(iLoopcounter) = "AFMA Green" Then
Set SourceFolder = SourceFolder.Folders(iLoopcounter)
Exit Do
End If
iLoopcounter = iLoopcounter + 1
Loop
To add to the problem I have Four mailboxes
Any thought would be great
Mark Scholes