Parse --moved from Introductions

hi moke

The email that is received shows the First 2 lines as this:-

From: Elise Kelman
Email Address:

Further down the Message body of the email there are an additional 2 lines as shown:-

Name: Elise Kelman

Email Address: km@gmail.com<mailto:km@gmail.com>

I am trying to adjust your original code to cater for this email structure.

In your first code you removed the From: line using strOut.

I am trying to do the same with this line:-

strOut = Replace(varString, "From:", "", "EMail Address:", "") 'remove "From:" and "EMail Address from the 0 and 1 position
 
Hi NG

For the sake of clarity, it IS possible to link to a non-default OutLook folder with VBA. It takes a bit of fancy coding but it is possible. It took me over a year and a whole gaggle of google searches, but I eventually got it sorted out.

If anyone is interested, I can provide the link to the thread...

Not sure what you mean by a non-default Outlook folder.
Having just been reminded about this I can import:
- all emails from a specified folder
- contact details etc
What I can't do so far is just import those emails still the Inbox.
Any ideas?

If the link helps, then yes please...
 
so I think what you want to do is drop the From and first email address, is that correct? one simple way would be to just remove them from the .addnew portion of the code.

Code:
From: Elise Kelman
Email Address: 
Subject: [Open Course Individual Booking - Elementary Food Hygiene - 27/09/2017]

Message Body:
Name: Elise Kelman

Email Address: km@gmail.com<mailto:km@gmail.com>

Phone Number: 023456081614

in my original code I removed the from title before doing the rest of the replacements. the difference would look like this, (just using whats shown above)

removing the from first

Code:
Elise Kelman | | [Open Course Individual Booking - Elementary Food Hygiene - 27/09/2017] | | Elise Kelman|km@gmail.com<mailto:km@gmail.com> |023456081614

removing the from along with the other replacements

Code:
| Elise Kelman | | [Open Course Individual Booking - Elementary Food Hygiene - 27/09/2017] | | Elise Kelman|km@gmail.com<mailto:km@gmail.com> |023456081614

the code is dependant upon the positions in the array
0|1|2|3|4|5|6|etc.

so using
Code:
 strOut = Replace(varString, "From:", "", "EMail Address:", "") 'remove "From:" and "EMail Address from the 0 and 1 position
would leave the values after them in the 0 position
so the easiest thing would be to adjust the code after the .addnew

Code:
rs.AddNew
rs!Subject = trim(strWrite(2))
rs!MessageBody = trim(strWrite(3))
rs!Name = trim(strWrite(4))
rs!EmailAddress = trim(strWrite(5))

HTH
 
Afternoon Colin, non-default folders are shared folders on a server. In my case, formatted messages get placed in a shared folder that I link to for parsing/import.Here is the link:https://www.access-programmers.co.uk/forums/showthread.php?t=291562This was important to me because it allows users to link to the folder without having to "get under the hood" (shift bypass) to link the folder.I have since incorporated a Public Type function that allows me to store user info into public variables so that I do not have to semi-hardcode the user's email address.Give it a look and let me know how it works out for you.
 
Last edited:
Hi

Thanks for the link which I'll save for the future.

At the moment, I don't need to be able to access shared folders on a server.

However I would like to be able to import all emails in the Outlook Inbox i.e. those I haven't moved into folders

When I try this in both Access 2010 & Access 2016, I get this:

attachment.php


Odd as the wizard works perfectly when importing from a folder

Any ideas?
 

Attachments

  • Capture4.PNG
    Capture4.PNG
    11.2 KB · Views: 204
Hi Colin

You can set up a specific Mail Rule to Move a Copy of whichever EMail that you have Received From Someone with Specific Words in the Subject Line.

Hope this helps?
 
True & I do know how to do this.

I was wondering if its just me who can't do import from the inbox itself or a global rule.

In other words am I wasting my time trying to do this?
 
Colin,

I have just successfully imported my inbox from Outlook 2007 using the wizard.

HTH
True & I do know how to do this.

I was wondering if its just me who can't do import from the inbox itself or a global rule.

In other words am I wasting my time trying to do this?
 
Colin,

I have just successfully imported my inbox from Outlook 2007 using the wizard.

HTH

Hi Gasman

Thanks. That prompted me to try again

I tried this on 2 computers using Access 2010 & 2016 with 3 different email accounts. Both computers have Outlook 2016

For my 2 POP3 accounts on both computers, I get the wizard not installed message (as in my previous post) when trying to import the inbox itself.
Individual folders imported with no problems

However I also have an IMAP email account.
The inbox for that one imported successfully on both computers

So in other words, the problem is only with .pst folders

I then researched online:
https://answers.microsoft.com/en-us/office/forum/office_2010-access/access-2010-cant-find-wizard-to-link-table-to-ms/ca68aaca-8aba-461c-b6e2-4c57f616e80f?auth=1

It seems that lots of people have this problem but generally it prevents any emails being imported.

Various fixes suggested:
a) checking the wizard is in a trusted location - it was already
b) checking the .pst file is in a trusted location - DONE
c) changing the name from Outlook.pst to something else - DONE
d) changing the .pst file name to at least 16 characters - DONE

NONE of those fixed it for me

Eventually I tried changing it to this: Colin's Outlook Datafile.pst
i.e. a long name with spaces and an apostrophe
(breaking all the rules about names for Access database items!)

AND NOW IT WORKS!!! :o

I have absolutely no idea why but that fixed it. Madness!
 
Last edited:
Nice one. :D
I was going to suggest service packs?, as I had a problem with a few computers in work, and it was down to being a service pack adrift.
 
UPDATE:
Realised my email notifications had stopped .... and thought here we go again.

But no.
Whilst the solution in my last post fixed the email import issue, it also stopped me sending or receiving emails from that account! :banghead:

Repairing the email account didn't work
Deleting & recreating the account DID work. PITB! :p
 

Users who are viewing this thread

Back
Top Bottom