Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

MS access to import specific mails subjects from outlook

Question posted by: Isecretl (Newbie) on July 24th, 2008 02:45 AM
Dear Friends,


As i am totally without knowledge on VB, would like to check you guy as I have a little situation on my hands now, the situation is described as follows,

I am using MS exchange 03 server as my mail server and I have a acess 2003 as my database for my web application
Now from time to time I will receive certain emails with specific headers, how can I pick up these emails by detecting their subject header and thereafter import the body wholesale into a specific table in my access? I have tried the import wizard but it simply loads all my mails into a new table in my access. Any assistance is greatly appreciated thanks guys

Cheers
IceBower's Avatar
IceBower
Newbie
15 Posts
July 24th, 2008
01:16 PM
#2

Re: MS access to import specific mails subjects from outlook
Have you tried using the link table wizard instead? (select outlook as the file type.) Link your outlook inbox to the application that way then you can set up queries and coding to get the data you require.

Reply
Isecretl's Avatar
Isecretl
Newbie
4 Posts
July 25th, 2008
12:47 AM
#3

Re: MS access to import specific mails subjects from outlook
Quote:
Have you tried using the link table wizard instead? (select outlook as the file type.) Link your outlook inbox to the application that way then you can set up queries and coding to get the data you require.



hi

currently to simplify it i have the below 2 existing tables

Table 1 : knowledge_tbl
Table 2: inbox

the inbox is a link to my exchange. now the knowledge_tbl is the table that displays all my data that is presented to my department. as i am relatively having zero knowledge to this. i am seeing 2 tables of wich i need to extract table 2 data automatically into table 1. i can perform a sql query from within access itself to query table 2 and insert data into table 1? the portal language is done in asp. Thank you for your kind assistance

Reply
IceBower's Avatar
IceBower
Newbie
15 Posts
July 25th, 2008
12:37 PM
#4

Re: MS access to import specific mails subjects from outlook
Quote:
hi

currently to simplify it i have the below 2 existing tables

Table 1 : knowledge_tbl
Table 2: inbox

the inbox is a link to my exchange. now the knowledge_tbl is the table that displays all my data that is presented to my department. as i am relatively having zero knowledge to this. i am seeing 2 tables of wich i need to extract table 2 data automatically into table 1. i can perform a sql query from within access itself to query table 2 and insert data into table 1? the portal language is done in asp. Thank you for your kind assistance


I think i get what your after...

Try an SQL like this:

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO knowledge_tbl ( Field Name )
  2. SELECT inbox.Contents
  3. FROM inbox
  4. WHERE ((Important.subject)="what your filtering by")

Reply
Isecretl's Avatar
Isecretl
Newbie
4 Posts
July 30th, 2008
05:44 AM
#5

Re: MS access to import specific mails subjects from outlook
Quote:
I think i get what your after...

Try an SQL like this:

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO knowledge_tbl ( Field Name )
  2. SELECT inbox.Contents
  3. FROM inbox
  4. WHERE ((Important.subject)="what your filtering by")



Hi IceBower, first up i wanna thank you for the assistance.

I have tried your query however, it simply inserts all my mails from my inbox no matter what changes i make to the where clause on top of that my main concern is that it will actually write into my table over and over again. meaning to say a email i recieved 2 weeks ago if i never delete, if i run the query again it will actually write it in again. any advice?

my query:

INSERT INTO kb_items ( Body )
SELECT inbox.Body
FROM inbox
WHERE ((Important.subject) = "blackberry")

Reply
IceBower's Avatar
IceBower
Newbie
15 Posts
August 12th, 2008
02:23 PM
#6

Re: MS access to import specific mails subjects from outlook
Quote:
Hi IceBower, first up i wanna thank you for the assistance.

I have tried your query however, it simply inserts all my mails from my inbox no matter what changes i make to the where clause on top of that my main concern is that it will actually write into my table over and over again. meaning to say a email i recieved 2 weeks ago if i never delete, if i run the query again it will actually write it in again. any advice?

my query:

INSERT INTO kb_items ( Body )
SELECT inbox.Body
FROM inbox
WHERE ((Important.subject) = "blackberry")


Isecretl, sorry about the late reply. If you replace 'important' with 'inbox' then this code shoudl work.

As for stopping it replicating the messages, the best way to do this would be to create a record set in VB and hard code the query aswell, that way you could check if the table already contains another similar email.

If you need help writing this code then just let me know

Reply
Isecretl's Avatar
Isecretl
Newbie
4 Posts
August 13th, 2008
01:04 AM
#7

Re: MS access to import specific mails subjects from outlook
Quote:
Isecretl, sorry about the late reply. If you replace 'important' with 'inbox' then this code shoudl work.

As for stopping it replicating the messages, the best way to do this would be to create a record set in VB and hard code the query aswell, that way you could check if the table already contains another similar email.

If you need help writing this code then just let me know



dont worry about it i appreciate your kind assistance. due to the nature of this scope as it needs to run preferrably hourly 24 / 7 (Meaning run the query)

i actually tried to set a rule in outlook to forward the incoming mails into a seperate folder. Once there, there is a linked table from ACCESS to that particular folder. I then schduled a ms task to run a asp to query and extract accordingly.

Here is a little dilemma, when i query from MS access itself the query works fine, but when i put the query into asp i get this

"There are no MAPI clients installed on this machine. Install a MAPI client (like Outlook) on this machine"
*outlook is installed on my notebook as well as the server hosting the IIS*


The moment i change the query to query another normal table in access the asp works fine...

i am really unsure if i am going in the right course but when i tried to search on the net for this error for 3 days now, no progress i am really depressed lol

Reply
Reply
Not the answer you were looking for? Post your question . . .
190,181 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Visual Basic Forum Contributors