Results 1 to 1 of 1

Pulling UserForm Data into Email Module

Threaded View

kujoking7 Pulling UserForm Data into... 07-09-2015, 09:56 AM
  1. #1
    Registered User
    Join Date
    02-13-2015
    Location
    Seattle, WA
    MS-Off Ver
    2013 (Work) & 2016 (Home)
    Posts
    33

    Pulling UserForm Data into Email Module

    Hello everyone,

    So I am creating a project management tool for my company. The way to create a project involves entering data into a UserForm. Two of the form inputs that I currently am looking at are called "txtAssignedTo" and "txtAssignedBy". I currently have this macro running once the user submits the form:

    Sub NewProjectEmailMacro()
    'Email workbook to specified users
        Dim wb1 As Workbook
        Dim OutApp As Object
        Dim OutMail As Object
    
        With Application
            .ScreenUpdating = False
            .EnableEvents = False
        End With
    
        Set wb1 = ActiveWorkbook
    
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)
    
        On Error Resume Next
        With OutMail
            .To = ""
            .CC = ""
            .BCC = ""
            .Subject = "A New Project has been Created"
            .Body = "A new project in the Project Tracker has been created. Please advise."
            .Attachments.Add ActiveWorkbook.FullName
            .Send
        End With
        On Error GoTo 0
    
        Set OutMail = Nothing
        Set OutApp = Nothing
    
        With Application
            .ScreenUpdating = True
            .EnableEvents = True
        End With
    End Sub
    Currently, I am only able to know how to input specific email addresses into the "To" section of the macro. What I am looking to do is somehow be able to input the user values of "txtAssignedTo" and "txtAssignedBy" into the "To" section to send an email to only those two people. Also, I believe I will need to concatenate the final part of the email address (@yahoo.com for example will not be included in the form).

    Any help is greatly appreciated and thank you as always!
    Last edited by kujoking7; 07-09-2015 at 05:32 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] UserForm Listbox pulling data from another workbook
    By ElianaMG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-02-2015, 03:10 PM
  2. Error...When pulling data from worksheet to UserForm
    By z-eighty2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-12-2014, 03:07 AM
  3. [SOLVED] VBA Userform Pulling data from txt file
    By TalResha in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-18-2012, 08:33 AM
  4. Word userform pulling data from Excel
    By Freaky_zoid in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 04-02-2009, 05:38 AM
  5. Questions on passng data between UserForm, Module
    By Dennis Benjamin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2005, 05:35 AM

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