+ Reply to Thread
Results 1 to 12 of 12

Standard e-mail letters in Outlook 2007

  1. #1
    Forum Contributor
    Join Date
    12-30-2013
    Location
    Falun, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    112

    Standard e-mail letters in Outlook 2007

    Hi,

    I try to write a VBA module to copy/write identical e-mail letters with a certain text, a subject and attached files. The only difference between the mails should be the different e-mail addresses.

    Can someone help me?

    Kind regards,

    Jan

  2. #2
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Standard e-mail letters in Outlook 2007

    This site has all the examples and instructions you need;

    http://www.rondebruin.nl/win/s1/outlook/mail.htm
    If I helped in any way, please click the star

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Standard e-mail letters in Outlook 2007

    Hi Jan

    Ron de Bruin is the go to guy for me when writing Email from Excel to Outlook Code. Here's a link

    http://www.rondebruin.nl/win/s1/outlook/amail1.htm

    Need help let us know.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    12-30-2013
    Location
    Falun, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Standard e-mail letters in Outlook 2007

    Hi again!

    I try the following code but cannot get the body text or the attachement (pdf-file). Is the body text too big? Where to put the quotation marks in the body text?


    Please Login or Register  to view this content.
    Kind regards,

    Jan

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Standard e-mail letters in Outlook 2007

    Hi Jan

    Modify this Code to suit. If you need assistance, let us know.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Standard e-mail letters in Outlook 2007

    Jan, you did fairly well for the first attempt.
    Based on your attempt in post #4, this should get you where you want to be. Just adjust the file path to find the actual file you want to send. I made a basic assumption of the generic path.

    Please Login or Register  to view this content.
    Last edited by Jim885; 12-20-2014 at 07:47 PM.

  7. #7
    Forum Contributor
    Join Date
    12-30-2013
    Location
    Falun, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Standard e-mail letters in Outlook 2007

    Hi all of you,

    The module functions now properly with one exception.

    I want some of the text in the "Body" or in the "strbody" in italic.
    How is the code for that?

    Kind regards,

    Jan

  8. #8
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Standard e-mail letters in Outlook 2007

    I found it best to rewrite the code a little to accomplish changing the font style.

    Again, based on your attempt in post #4, this will suit your new request.

    To make any part of your text italic, simply place <I> before the section you want to italicize, and place </I> after the section of text. Always make sure the < I > or < / I > is within the quote marks. Such as in this example "<I><B>Hello,</B></I>"

    I also added bold face to the code ( <B> and </B>) in addition to making the font italic with the use of ( <I> and </I>) in case you also wanted that option as well.
    Please Login or Register  to view this content.
    I believe this will solve your request. So, if you could be so kind as to mark this thread SOLVED and leave a rep, it will be appreciated. Thanks!
    Last edited by Jim885; 12-21-2014 at 12:37 PM. Reason: typo

  9. #9
    Forum Contributor
    Join Date
    12-30-2013
    Location
    Falun, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Standard e-mail letters in Outlook 2007

    Hi Jim885,

    When I add some html-code the vba-code for new lines does not function. The italic text is OK.

    How should the code be changed from vba to html for accepting new lines?

    Kind regards,

    Jan

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Standard e-mail letters in Outlook 2007

    Jan,
    Using HTML coding requires <br> instead of "& vbNewLine"

    You can see I used <br> in post #8 but did not point that out.
    So this would be the complete code for your final result.


    Please Login or Register  to view this content.
    All you would need to do is add or subtract any of the <br> items you need to format the email as you wish. Remember to keep those inside the quote marks too.
    Last edited by Jim885; 12-21-2014 at 03:24 PM.

  11. #11
    Forum Contributor
    Join Date
    12-30-2013
    Location
    Falun, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Standard e-mail letters in Outlook 2007 SOLVED

    Hi Jim885,

    The macro functions now properly using HTML code.

    Thank you very much for excellent help.

    Kind regards,

    Jan

  12. #12
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Standard e-mail letters in Outlook 2007 SOLVED

    Quote Originally Posted by Jan Rennel View Post
    Hi Jim885,

    The macro functions now properly using HTML code.

    Thank you very much for excellent help.

    Kind regards,

    Jan
    You are welcome. Glad you are happy with it.

    If you could be so kind as to mark this thread SOLVED and leave a rep for me, it will be appreciated. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Outlook 2007, Referencing mail Item created from outlook template
    By thusidie in forum Outlook Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2014, 04:33 PM
  2. [SOLVED] Help needed : Linking outlook standard mail format with excel hyperlink
    By Elangovan89 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-03-2014, 08:09 AM
  3. Excel 2007 Outlook e-mail if cell value is 500 or higher
    By caf20012 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-16-2014, 05:43 AM
  4. [SOLVED] Click to send outlook mail (outlook 2007 )
    By ks1102 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2014, 02:54 AM
  5. Excel 2007/ Outlook 2007 mail Problem
    By Bostock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2007, 04:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1