Bulk Outlook Emails with CC and Attachments and Priority using Excel VBA

Поделиться
HTML-код
  • Опубликовано: 15 окт 2024
  • Welcome to my ExcelPowerTips Channel!
    This video shows you the power of Excel VBA to dynamically via a loop compose and send an Outlook Email for each row of an Excel Dataset containing the required information.
    It also shows you how to add the primary and multiple CC circular email addressees with multiple attachments and set the priority for each one.
    This method also uses late binding where the Outlook Application object is created during runtime so you don't need to go the the VBA editor menu to select references for the Outlook Object library.
    Doing it this way makes it easy to share your Excel workbook with users without issues.
    If you enjoyed watching this video consider subscribing and share this amazing Excel Power Tip with others.
    Enjoy!
    LIKE - SUBSCRIBE - COMMENT - SHARE - ENJOY!

Комментарии • 6

  • @excelpowertips7447
    @excelpowertips7447  6 месяцев назад +1

    Yes you should be able to attach any document file as you specify the full path in the Excel sheet for the VBA code to pick.
    Thanks for watching.

  • @aishwaryapatra4975
    @aishwaryapatra4975 2 месяца назад

    Hi Sir, I have a doubt. If in a single sheet multiple customers are there and I need only one email for that while creating the bulk email, then what should be the code

    • @excelpowertips7447
      @excelpowertips7447  2 месяца назад

      If you want to just one email with all the recipients in that email then this code might help you:
      Remove the outer loop and create a single loop just to gather all email addresses and put into one string like below to a string variable like below:
      strSingleBulkEmailAddress = ""
      ' Compose the single bulk email To string for multiple recipients via loop
      For intRow = 2 To intLastRow
      strSingleBulkEmailAddress = strSingleBulkEmailAddress + wSht.Range("C" & intRow).Value + ";"
      Next intRow
      Hope this helps you and please share this very useful Excel Power Tip.

    • @aishwaryapatra4975
      @aishwaryapatra4975 2 месяца назад

      @@excelpowertips7447 I am sorry that I explained wrong might be. My doubt is if in a sheet there is a single customer for 5 times but I want to use only one email for those 5 times with a same customer. I can't delete it because different invoices are the for one customer

  • @siddharth9643
    @siddharth9643 2 месяца назад

    Hii sir..
    I want to send excel table to outlook to more recipients... Can you help me how to create that

    • @excelpowertips7447
      @excelpowertips7447  2 месяца назад +1

      So my example contains Two columns in the Excel sheet in columns C and D to pick up the To and CC email address in the VBA Loop code. To include more recipients you will either need to add new columns for each recipient or add the new recipients directly in code with a new CC list like this anonymous example:
      ' Set email properties
      With OutlookMail
      .To = wSht.Range("C" & intRow).Value ' Employee main email
      .CC = wSht.Range("D" & intRow).Value ' Manager Circular email
      ' For more than one CC separate with a semi-colon
      .CC = "New_Recipeint_1@gmail.com" & ";" & _
      "New_Recipeint_2@gmail.com" & ";" & _
      "New_Recipeint_3@gmail.com" & ";" & _
      "New_Recipeint_4@gmail.com" & ";" & _
      "New_Recipeint_5@gmail.com" & ";" & _
      "New_Recipeint_6@gmail.com" & ";" & _
      "New_Recipeint_7@gmail.com" & ";" & _
      "New_Recipeint_8@gmail.com"
      This is the part of the code you need to adjust to include the new recipients (make sure you separate each email address with a semi-colon ";" as per above.
      It's a great question and hope this helps you.
      Thanks for watching and please share this Excel Power Tip.