Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Lounger
    Join Date
    Aug 2004
    Posts
    47
    Thanks
    2
    Thanked 0 Times in 0 Posts

    e-mail different tabs in excel (excel 2000)

    I have a list of supervisors I need to sent e-mail to. I can creat tab for each supervisors and I like those tab to be the attachment in the e-mail. I have some problems with the e-mail content. The e-mail contents are in the macro "Outlook_Mail_Every_Worksheet", but I do not know how to customized the contents. For example, how to make a line underlined, how to add bullet point, make the font smaller, change the color of a word. I'm attaching a sample here. The first macro is creating tab, the second marco is senting out the e-mail. I got some help here to get those two macro done. Thanks in advance for your reply.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: e-mail different tabs in excel (excel 2000)

    Are you using HTML as the message format?
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Lounger
    Join Date
    Aug 2004
    Posts
    47
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: e-mail different tabs in excel (excel 2000)

    I don't know what does message format mean. I'm using MS outlook. The e-mail I plan to send out is just a regular e-mail with title, e-mail content and an attachment. Is is a HTML format? I have problem with the e-mail content. e.g. For some words, I like them to be underlined.

  4. #4
    Lounger
    Join Date
    Aug 2004
    Posts
    47
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: e-mail different tabs in excel (excel 2000)

    It's RTF.

  5. #5
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: e-mail different tabs in excel (excel 2000)

    I think you would have to compose it in a program that could create RTF files (like word) and then email from their.

    It might be possible to have excel open word, have word create, the RTF file, and then send the RTF file from outlook. I would think that you would need someone conversant in word and outlook to do the programming in those languages to send it out, even if you do have excel VB open them. The vb coding uses the word and the outlook object models, not excel's

    Steve

  6. #6
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: e-mail different tabs in excel (excel 2000)

    It might be easier to use HTML format mail, according to this site you would just need to create the correct html syntax in a string and set the HTMLbody property of your message to that string.

    StuartR

  7. #7
    Lounger
    Join Date
    Aug 2004
    Posts
    47
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: e-mail different tabs in excel (excel 2000)

    But how to pick the appropriate tab as e-mail attachment at the same time?

  8. #8
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: e-mail different tabs in excel (excel 2000)

    Are you asking about how to find the correct Excel worksheet? In that case one of the Excel experts here should be able to help you.
    <big>[/b]OR[/b]</big>
    Is your query about how to attach the worksheet to an Outlook message? In which case I will move this whole thread to the Outlook board where the people who might be able to help you hang out.

    StuartR

  9. #9
    Lounger
    Join Date
    Aug 2004
    Posts
    47
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: e-mail different tabs in excel (excel 2000)

    What the marco(in my sample attachment) did is to pick the right worksheet as an attachement and sent out an e-mail to managers. The e-mail content is embedded in the macro so I cannot format the content (like underline certain words).

    I'm wondering how to format the content and at the same time I can still use the macro to pick the attachment.

  10. #10
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: e-mail different tabs in excel (excel 2000)

    OK, I've moved this whole thread from the Excel board to the Outlook board so the people who understand the Outlook object model can offer you some help.

    StuartR (who knows even less about the Outlook object model than he does about the Excel one)

  11. #11
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: e-mail different tabs in excel (excel 2000)

    It's not that easy to do, because Outlook's VBA Object model treats the entire Body of the message as a single Object, unlike Word where the message body is comprised of child objects such as paragraphs and sentences.

    So, as has already been discussed, OP <!profile=knini>knini<!/profile> will have to write the text to an RTF file, which is probably best done in a Word doc, and then move that content to the Body of the message. Or switch to HTML format and code the HTML tags into the message body, which I have done only at a very elementary level.

    I took a quick look at Steve's <!profile=sdckapr>sdckapr<!/profile> suggestion of building the RTF in Word and then sending it as a message, which works great for the message body, but the SendMail method in Word doesn't appear to provide for adding attachments in code, though it can be done manually. In this case, it could be due to my lack of knowledge of Word Object Model. (Rimshot!)

    Stuart, I'll take a shot at working on this if someone (you!?) can help me with starter code for creating text in Word in RTF format.
    -John ... I float in liquid gardens
    UTC -7ąDS

  12. #12
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: e-mail different tabs in excel (excel 2000)

    The easiest way to write the message body with formatting is to use HTML. Easy if you know some HTML. <img src=/S/grin.gif border=0 alt=grin width=15 height=15> A message in HTML format has an .HTMLBody property. It is a string that consists of all the HTML in the message body. (If you look at some HTML messages saved from Outlook as examples, you can ignore the message headers.) In some old code, I found this line, suggesting that it is useful to include <HTML> and </HTML> tags around your new "body" text:

    .HTMLBody = "<HTML><BODY>" & vbCrLf & strBody2 & vbCrLf & "</BODY></HTML>"

    Hope this helps.

  13. #13
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: e-mail different tabs in excel (excel 2000)

    See also the text file I added earlier in the thread; if renamed *.htm, it does some of what the OP is requesting, but I don't know how to make the tags any more concise, and I don't know then all.
    -John ... I float in liquid gardens
    UTC -7ąDS

  14. #14
    Lounger
    Join Date
    Aug 2004
    Posts
    47
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: e-mail different tabs in excel (excel 2000)

    Are you talking to me or talking to John? I can hardly understand what you mean.

    Do you mean insert .HTMLBody = "<HTML><BODY>" & vbCrLf & strBody2 & vbCrLf & "</BODY></HTML>" somewhere in the VB coding? Is Body2 my e-mail content?

  15. #15
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: e-mail different tabs in excel (excel 2000)

    This text file has Excel VBA code that will create the required formatted text in a word document, copy the lot to the paste buffer, and destroy the word document again.

    Can you Paste this into a mail item?

    StuartR

Page 1 of 2 12 LastLast

Posting Permissions

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