Results 1 to 7 of 7

outlook email to textbox variable

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    outlook email to textbox variable

    Below is my coding and attachment of what I want looks like.
    Private Sub TextBox1_Change()
        Dim strName As String
        Subject = UserForm1.TextBox1 <- I dont think this is correct
    End Sub
    
    Private Sub TextBox2_Change()
        CC = UserForm1.TextBox2 <- I dont think this is correct
    End Sub
    
    Private Sub TextBox3_Change()
        Message = UserForm1.TextBox3 <- I dont think this is correct
    End Sub
    Private Sub CommandButton1_Click()
        Unload Me
    End Sub
    
    Sub CommandButton2_Click()
    Set myOlApp = CreateObject("Outlook.Application")
    Set myNamespace = myOlApp.GetNamespace("MAPI")
            Set objMail = myOlApp.CreateItem(olMailItem)
                With objMail
                    .Subject = Subject <- how do i link this to "I dont think this is correct"
                    .To = Environ("username")
                    .body = Message <- how do i link this to "I dont think this is correct"
                    .CC = CC <- how do i link this to "I dont think this is correct"
                    .Send
    End With
    'below i dont understand why it's there and nothing or if needed
    Set myOlApp = Nothing
    Set myNamespace = Nothing
    Set myRecipient = Nothing
    Set objMail = Nothing
    End Sub
    Attached Images Attached Images
    Last edited by JBeaucaire; 09-10-2012 at 09:39 PM. Reason: Added code tags, as per forum rules. Don't forget!

Thread Information

Users Browsing this Thread

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

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