UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Identifying Records In Linked Outlook Inbox Table    
 
   
muse43
post Sep 15 2016, 11:04 AM
Post#1



Posts: 30
Joined: 21-January 13



Hi,

I am a beginner Access developer. I am building an email manager program for a client. I have most of it complete.

I am having trouble with the following though: I am able to successfully pull bounceback email addresses from the inbox (using a number of functions like instr() etc). I then mark those email addresses as "bad emails" after 3 bouncebacks. To avoid double counting the bouncebacks whenever the program runs, I want to delete these messages after recording the bounceback event.

The problem is that the linked Outlook table does not have any unique or ID field. I've tried a couple things including:

1. Tried creating my own "Index" using: last 6 character of: the size of the message x Time Received. This gave me unique numbers for each record but when running queries using that field, it simply wasn't selecting the right records. Still not sure why after playing with it for quite some time... I'm still wondering if this is a possible solution that I just didn't get quite right for some reason.

2. I've tried using the original query (based directly off of the inbox table) that finds the bounce back emails, copying that query and making it a DELETE query. This does delete the records from the inbox. However, it doesn't get the job done. The reason is a bit complicated but basically, it deletes ALL the records found but when I am marking a bounceback event, I check the address found vs. addresses in my contact list first and only mark as bounceback if address exists in contact list. I only want to delete THOSE messages and not all found.

So I'm thinking I need an ID field of some kind to use to track which messages have been confirmed as bouncebacks and then delete those. I'm also thinking that there has to be some kind of ID used no? I mean, when I delete directly from the inbox table, how does access know which record to actually delete otherwise?? Or maybe I'm missing something here as I'm no expert...

Thanks!
Go to the top of the page
 
DanielPineault
post Sep 15 2016, 11:49 AM
Post#2


UtterAccess VIP
Posts: 5,452
Joined: 30-June 11



Build your own table through VBA and include the message's EntryID and use it for deletion purposes.

Another alternative would be to use Outlook Automation to restrict the message with multiple elements that you possess and if only one match is found delete it. If multiple matches are found, then you'd need to prompt the use I guess.
Go to the top of the page
 
muse43
post Sep 15 2016, 12:23 PM
Post#3



Posts: 30
Joined: 21-January 13



Thanks Daniel for the reply!

I guess I could build a temp table and add my own ID but if I do that and then use it for deleting, won't I just be deleting records from that new table and not from the actual Outlook table?

Thanks again!
Go to the top of the page
 
DanielPineault
post Sep 15 2016, 12:58 PM
Post#4


UtterAccess VIP
Posts: 5,452
Joined: 30-June 11



Sorry, my previous post was a little light on details.

Everything depends on what you need to do exactly. You could do everything directly through automation, if it is straightforward. Otherwise, you could, connect to outlook, extract a list of e-mails (EntryID, Subject, E-mail address, ...) and push them to your table, perform your routines to identify which ones need to be deleted and then reconnect to Outlook and delete them based on the EntryID for each selected record.

Remember, if you go down the road of temp tables, normally it is a good idea to create a separate throw away BE to house them in this way it doesn't bloat your main FE/BE.
Go to the top of the page
 
muse43
post Sep 16 2016, 12:05 PM
Post#5



Posts: 30
Joined: 21-January 13



OK, I think I'll definitely need to get them into Access so that I can compare to my contacts list and make updates to them as well.

So I can extract the emails, save them to a table and then identify which ones I want to delete. So far, I've been able to set that up. I've added my own EntryID field to my temp table but this field does not exist in the Outlook table. So when I go to delete from that table, I cannot identify which ones are the ones I've marked for delete..... does that make sense?

Thanks for the advice about a throw away BE... this is not the first time I've been forced to use temp tables so I'll definitely use that approach in the future...
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    16th December 2017 - 02:00 AM