Copy from Lotus note body in mail to excel cells.

  • HI. All.


    I need an excel macro to get different data from lotus notes text body and paste it into excel cells. I've looked hard searching through the Internet but it seems as is everybody is only interested in sending e-mails but not getting text data. Hope someone can help out here.
    So I guess this is a one of the hard ones.


    I found below code but in my excel 2003 I never reach to be able to test it, it give me errors.
    But maybe some of the experts here can use it or change it or maybe some know another code to use.
    Because of limited user who knows about lotus notes its cross posted in hope of some knows how to help with this.http://www.excelforum.com/exce…-mail-to-excel-cells.html
    http://www.mrexcel.com/forum/e…el-cells.html#post3994441
    Thanks in advance.


    Sincerely


    Abjac


    My found not working code.


  • Re: Copy from Lotus note body in mail to excel cells.


    See if this gets you started. It loops through all emails in the Lotus Notes Inbox and displays the email body text. You would need to modify the code slightly to extract the text into Excel cells.

  • Re: Copy from Lotus note body in mail to excel cells.


    Hi. John. Wow it really open all the mails body text in the inbox and display it in notepad. Could you please help so it only open the mail which is open. That's how I need it. Please see if you can change it to only open the mail which is open. Then I will try work with to get it to excel instead of notepad. But its a start for sure and the first one in many places so thanks allot for now. But need help I think to get it to open only the mail which is open.If you could have a look at that it will be great. Sincerely Abjac

  • Re: Copy from Lotus note body in mail to excel cells.


    Try this. It displays the body text of the currently open email.

  • Re: Copy from Lotus note body in mail to excel cells.


    Hi. John it works really perfect. It do exactly what it have to do. I am still struggling with how to get it into excel from column start A2 instead of going to a message box. If you know and can solve that it would be so perfect. Thanks Sincerely Abjac

  • Re: Copy from Lotus note body in mail to excel cells.


    This puts each line of the email body into Excel column A starting at A2.

  • Re: Copy from Lotus note body in mail to excel cells.


    Hi John Wow. It work just perfect. Its brilliant I have asked about this many places and no answers or nothing found on the internet also. Its brilliant. Thanks allot really great.. Have a nice day. Sincerely Abjac

  • Re: Copy from Lotus note body in mail to excel cells.


    Hi. John_W. I have a question your code is really great. But i need to know if its possible to get a table out from the mail. Now i get the body text. But what i have and need is a form in the mail with tables and columns. And this is the one which i need to work with in excel. Is it possible to get this out as a table+
    Please if time have a look.


    Sincerely


    Abjac

  • Re: Copy from Lotus note body in mail to excel cells.


    It's difficult to help without me seeing the email body text and how the table is constructed, in terms of characters and bytes. If you run the following code with a LN email open, it creates the file "Email_body.txt" in the same folder as the workbook, containing the email body bytes. If you post this text file here I will be able to see how the table is constructed. Also indicate exactly which bytes are the start and end of the table.

  • Re: Copy from Lotus note body in mail to excel cells.


    Hi. JOhn thats great i have to wait for tomorrow to get it done because its at my work i have it. But i will take a test with the upper macro. Infact it will be 2 tables nearly the same but not totally. But i will post tomorrow. Thanks allot for taking your time to help with this.


    Sincerely
    Abjac

  • Re: Copy from Lotus note body in mail to excel cells.


    That's useful. Can you also post screenshot images of the 2 email bodies, including any text above and below each table. That will let me relate the body bytes in the text files to the actual tables.

  • Re: Copy from Lotus note body in mail to excel cells.


    Hi. John. I think the submitter of the mail can change the text above the form, so its hard to say how much there will there. Below i guess it will common and will not change. But if i have to provide a complete textfile with screen shot. Could you PM me with you mail address, Its very confidental info which i cant really share here its related to my work.


    Text me back what you think
    Thanks
    Sincerely
    Abjac

  • Re: Copy from Lotus note body in mail to excel cells.


    HI John i send you the files. But also i think there is another way to handle it. When i use your code to get the body out from lotus mail to excel. It come out in lines. When i have these lines i delete all with a macro so all above the word Country Code is deleted and all below the word Revenue type is deleted. I can use this because then i infact have what i need to work with in the form. I use the text to columns in a macro with other delimiter :.
    It nearly works. But in some of the cell in the table there is more words which means they come out in another line in your macro.


    My idea could be in you macro which get it to excel to delete all above the Country Code and all under the word Revenue type. After that if its possible to make the output lines so it go to next line when it reach the third(3) : Then i think it would work perfect and quite secure that the out put is correct. I can then just use one macro text to columns with delimitter : and the result will be perfect every time.


    The form example

    Code
    Columns A       Column B                          Column C
    
    
    Country Code: Mandatory for all countries: 838
    Customer nr:   Mandatory:                        01

    If there is many words in column B it will put the output text file to a new line in the out put text file.


    So if this could be done in below file directly before it copy to excel i really think this could the solution and its secure.


    But have look at it and maybe you have other idea.


    Sincerely
    Abjac


    This is the code i talk about when it pull out to excel in a text file.


  • Re: Copy from Lotus note body in mail to excel cells.


    If you reply to my email with the files I requested I should be able to complete the code. One difficulty is the odd formatting of the table. It uses tab characters to separate each column and CR LF to separate each row. But it also uses CR LF in some cells to put the text in separate lines! That is why some words come out in the wrong row in the Excel cells.

  • Re: Copy from Lotus note body in mail to excel cells.


    Hello John,


    I know its an old thread but I really needs ur support here.


    http://<Snip>


    I have copied the body of the Lotus Notes email and tried to paste it into the Word document but it pastes a text/string, I wud need to have all the formatted texts also included while pasting. I tried to post this in many other blogs but hardly got any help.


    Awaiting for your favorable response!!!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!