+ Reply to Thread
Results 1 to 11 of 11

Genarate outlook mail by choosing content from combo box

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-08-2013
    Location
    Chennai, INDIA
    MS-Off Ver
    Excel 2010
    Posts
    157

    Question Genarate outlook mail by choosing content from combo box

    Hi,

    I have created an excel file that generate outlook emails ( using Ron de Bruin VB codes)

    I have a one more task to do with that.

    I have list of contents in a combo box... those contents are short form of the main contents that i want to be in the mail.

    if i select an content from the combo box and click mail macro it should open an mail with brief contents corresponding to the short content i selected in combo box.

    Please find the attachment for reference.

    I would appreciate a quick help.

    Thanks for your time...
    Attached Files Attached Files
    Bala

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Genarate outlook mail by choosing content from combo box

    If you will keep the cursor on short form before running the macro, replace your existing line of .HTMLBody to this one.
    .HTMLBody = ActiveCell.Offset(0, 1).Value & RangetoHTML(rng)
    ________________________________________________________
    If your problem is solved, update the thread as SOLVED: Go to the top of the first post-Select Thread Tools-Select Mark thread as Solved OR - Go to the first post - Click edit- Click Advance- Just below the word "Title:" you will see a dropdown with the word No prefix.- Change to Solve- Click Save.

    Show your gratitude to the person who helped you solving your problem by clicking on star button at the bottom of such post.

  3. #3
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Genarate outlook mail by choosing content from combo box

    If you still want to go with dropdown, may be this one can help.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    10-08-2013
    Location
    Chennai, INDIA
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: Genarate outlook mail by choosing content from combo box

    Hi haripopuri,

    Thanks it works well,

    I dont need the range to be in body of the mail if chose from dropdown box.

    Can it be done...

    and kindly let me why this below code is used??
    Sub DP()
    Debug.Print ActiveSheet.Shapes("Drop Down 6").Name
    End Sub

  5. #5
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Genarate outlook mail by choosing content from combo box

    I dont need the range to be in body of the mail if chose from dropdown box.

    Can it be done...
    Don't quite get it. For the other part, you can delete this line. That line puts the name of the box in immediate window. Was for my reference

  6. #6
    Forum Contributor
    Join Date
    10-08-2013
    Location
    Chennai, INDIA
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: Genarate outlook mail by choosing content from combo box

    Haripopuri,

    In my excel what i tried is macro will generate a new outlook mail with the specified range of cells in that excel as the body of the mail.

    My need is, in generating mail from combo box.. only the description of combobox should come in body of the mail... not that cell ranges.

    i think now im clear in my need. Thanks.

  7. #7
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Genarate outlook mail by choosing content from combo box

    You don't want the cells in excel body. Everything else should be same.. is that correct? If yes, then just remove RangetoHTML(rng) in this line of the code.
    .HTMLBody = MyStr & RangetoHTML(rng)

  8. #8
    Forum Contributor
    Join Date
    10-08-2013
    Location
    Chennai, INDIA
    MS-Off Ver
    Excel 2010
    Posts
    157

    Question Re: Genarate outlook mail by choosing content from combo box

    Hi Hari,

    Thanks. will try and come back to you...

    It would be a great help if you clarify me in below...

    I have query in where to place the below codes in the code what i have.

    All below codes are from ron de bruine

    To have few lines before the range of cells in body of the mail. please tell me where i need to paste this variable declaring and strbody codes.


    Dim strbody As String
        strbody = "Hi there" & vbNewLine & vbNewLine & _
                  "This is line 1" & vbNewLine & _
                  "This is line 2" & vbNewLine & _
                  "This is line 3" & vbNewLine & _
                  "This is line 4"
    I want my signature to be shown in the macro i run, for this please tell me where do ineed to paste this below codes, or is this codes to be put in a seperate module.

    Sub Mail_Outlook_With_Signature_Html_1()
    ' Working in Office 2000-2013
        Dim OutApp As Object
        Dim OutMail As Object
        Dim strbody As String
    
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)
    
        strbody = "<H3><B>Dear Customer Ron de Bruin</B></H3>" & _
                  "Please visit this website to download the new version.<br>" & _
                  "Let me know if you have problems.<br>" & _
                  "<A HREF=""http://www.rondebruin.nl/tips.htm"">Ron's Excel Page</A>" & _
                  "<br><br><B>Thank you</B>"
    
        On Error Resume Next
    
        With OutMail
            .Display
            .To = "[email protected]"
            .CC = ""
            .BCC = ""
            .Subject = "This is the Subject line"
            .HTMLBody = strbody & "<br>" & .HTMLBody
            .Send
        End With
    
        On Error GoTo 0
        Set OutMail = Nothing
        Set OutApp = Nothing
    End Sub

  9. #9
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Genarate outlook mail by choosing content from combo box

    bmbalamurali, stick to one question for a thread. You are keeping on expanding your requirement. Put all your questions in one go and that will save our time too.

  10. #10
    Forum Contributor
    Join Date
    10-08-2013
    Location
    Chennai, INDIA
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: Genarate outlook mail by choosing content from combo box

    Hari,
    Sorry... will try the last answer you gave and if it works.. i will make this thread resolved. Thanks.

    Will get my doubhts clarified through another thread in one go.

    Thanks for your time and consideration.

  11. #11
    Forum Contributor
    Join Date
    10-08-2013
    Location
    Chennai, INDIA
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: Genarate outlook mail by choosing content from combo box

    Hi Hari,

    Thanks....

    Is it possible to change the font and its size of the content what macro is generating in mail....????

    Please help...

+ 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. Macro code to copy excel sheet content to outlook mail
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2013, 07:18 AM
  2. SOLVED Choosing a value based on multiple cell content
    By morbdetro in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-26-2013, 02:37 PM
  3. code to attach the draft mail in new compose mail as attachment in outlook 2010
    By priya1987 in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2012, 08:38 AM
  4. Macro for extracting content of outlook mail body (contains table)
    By anchuri_chaitanya in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2011, 03:29 AM
  5. Launch Outlook and Get Mail Content from Excel
    By Vincent.Eymard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2010, 11:20 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