Object could not be found Error in Outlook 2007

Status
Not open for further replies.

vodkasoda

New Member
Outlook version
Outlook 2007
Email Account
POP3
I hope somebody can help me here ... to cut a long story short, I have had these VBA programs working for years but always run into problems when changing Outlook versions or Windows versions, I normally fix them reasonably quickly but I can't figure out what's wrong this time !!!

It may be the Outlook structure, or it may be something else, the truth is it is many years since I wrote it and absolutely ages since I last even looked at VBA code !!!

I am using the latest version of Windows 10 and Office Professional 2007.

This is the structure of my Outlook (ScreenHunter 63.png) ... and the relevant bits of code ... (ScreenHunter 64.png, ScreenHunter 65.png & ScreenHunter 66.png) ...

Then it crashes with the error in attachment ScreenHunter 67.png

It is surely something simple, but I just can't get my head around it, probably my age, but obviously not helped by not regularly programming :( !!!

Hopefully somebody can tell me what I need to change :)
 

Attachments

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
The windows version won't affect the code - and for the most part, if code works in 2007, it works in newer versions of Outlook (which doesn't affect you currently).

It says it can't find the object... i'm assuming it was the outlook item its processing. Was the item being processed an email message? NRDs, meeting requests, etc can cause macros to fail with similar errors.
 

vodkasoda

New Member
Outlook version
Outlook 2007
Email Account
POP3
Hi Diane, thanks for replying, yes, this program basically is my own Outlook Rules program ...
 

vodkasoda

New Member
Outlook version
Outlook 2007
Email Account
POP3
I get an enormous amount of E:Mails regarding a football game that I play and this program recognises those E:Mails and places them in specific Outlook Folders. I have a Folder called Kickabout (the name of the game) and a number of Sub-Folders within that Folder, as I understand it, the Kickabout Folder is at the same "level" as the Inbox.

I interrogate the Sender and the Subject of each E:Mail to get me the Folder where I want the E:Mail to go, so, for instance, the line ...

Set MyDest = GetFolder("\\Kickabout\Churchill")

... calls the GetFolder Function and should set MyDest to point at the Churchill Sub-Folder in order to execute the next line ...

MyEMail.Move MyDest

... and move the E:Mail to the correct Sub-Folder.

I must have originally got the GetFolder Function from an online site, as I don't understand what it's doing, it's certainly not my own code ... I have attached the whole Function to this post (ScreenHunter 69.png) ...
 

Attachments

vodkasoda

New Member
Outlook version
Outlook 2007
Email Account
POP3
I've solved it, previously my top level was called Gary, somehow when I have installed Word 2007 this time around I haven't renamed Personal Folders to Gary, so when I noticed that the Gary level wasn't there I removed it from my program but didn't replace it with Personal Folders !!!

Silly mistake but writing it all down like this helped me to resolve it, so thank you for listening :D !!!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Thanks for the update.

On the GetFolder Function, it's floating around the internet... you need it if you use multiple data files and want to do something in the non-default data file - the code finds the correct folder.
 
Status
Not open for further replies.
Top