+ Reply to Thread
Results 1 to 1 of 1

VBA code to email table as body using default mail app

  1. #1
    Registered User
    Join Date
    11-06-2022
    Location
    Australia
    MS-Off Ver
    Enterprise 2007
    Posts
    1

    VBA code to email table as body using default mail app

    Hello Everyone,
    First time posting, lets get into it.

    I'm making a parts order form for work. It has a list of all stocked items with part numbers, descriptions and recommended stock quantities.
    When you enter actual stock quantities it outputs order amounts of each item to Sheet 2 like below.

    Item QTY |Min QTY |Actual QTY |Order QTY |Part Number |Description
    5 pack | 5 |6 | 0 | 18711514 | A/C Fibre Washer for Bottle Fittings 5pk
    1 pce |4 |0 | 4 | 1498189519 |A/C Fitting Alu #10 45

    On sheet 2 I'm trying to have a button with a macro that emails the table of the stock order to a work address but my knowledge of Visual Basic code is limited.
    We don't use outlook because of compatibility issues and instead use Windows Mail, which I also use, so it needs to be sent via the default mail app. The only way I could find to do that is with cmd using Mailto.
    I have tried many different lines of code I could find online but i'm just getting error after error. Also I don't know how to get the table to insert into the body of the email using cmd.
    This is what I have at the moment;


    Please Login or Register  to view this content.
    I'm hoping what I want to do is even possible but googling for code for VB to insert a table into a mailto doesn't look to be anything anyone else has asked.
    Even trying CreateObject ("Outlook.Application"), OutMail it errors at the "Set order = Sheets" part. Most of the code is from the youtube video "Excel VBA Macro: Send Email With Table In Body (Dynamic Range)"
    But it uses outlook so have tried to adapt it for mailto.
    Thanks everyone.
    Attached Files Attached Files
    Last edited by ShaunTheBaa; 11-06-2022 at 01:27 AM.

+ 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. [SOLVED] Text Mail Body and HTML Body in same email
    By dflak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2022, 04:11 PM
  2. how to change the default background color of the body of an existing email
    By dmcgov in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2019, 07:13 AM
  3. Code to send email with table on the email body via gmail
    By ivhee00 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-19-2017, 12:24 AM
  4. VBA to perform mass email functions with Apple Mail (Macbook default email program)
    By thianphat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2014, 04:09 PM
  5. vba pull data from outlook body of email through email or subject of mail into excel
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 04:37 AM
  6. How to make an email body in an e-mail VBA?
    By hond in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2012, 05:18 AM
  7. Excel 2007 : Email 2007 excel format in body of mail
    By dbdanboat in forum Excel General
    Replies: 1
    Last Post: 01-21-2011, 07:47 AM

Tags for this Thread

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