Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
TextBox Values to Outlook
Hi
Add it to the message ProjName = Userform1.txbProjName.Value Unload Userform1 'more code strbody = "Hi there" & vbNewLine & vbNewLine & _ "This is line 1" & vbNewLine & _ "This is line 2" & vbNewLine & _ "This is line 3" & vbNewLine & _ "This is line 4" & vbNewLine & _ "Project name is " & ProjName 'more code regards Paul PW11111 wrote: Hi, Can I amend the following code so it inserts the values from a tex tbox on a userform into an outlook message. For example I have a textbox - txbProjName on my userform that shows the projects full name. Any help would be great. Sub Mail_small_Text_Outlook() ' Is working in Office 2000-2007 Dim OutApp As Object Dim OutMail As Object Dim strbody As String Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) strbody = "Hi there" & vbNewLine & vbNewLine & _ "This is line 1" & vbNewLine & _ "This is line 2" & vbNewLine & _ "This is line 3" & vbNewLine & _ "This is line 4" On Error Resume Next With OutMail .To = "" .CC = "" .BCC = "" .Subject = "WorkPlace Strategy: Executive Summery" .Body = strbody .Display 'or use .Send End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
TextBox Values | Excel Programming | |||
Textbox values | Excel Programming | |||
How do I add TextBox.values? | Excel Programming | |||
How do I add TextBox.values? | Excel Discussion (Misc queries) | |||
How do I add TextBox.values? | Excel Worksheet Functions |