LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Excel VB to create and send an outlook appointment with html code

I have started writing the code for what I want done. I have a worksheet with 40 columns and 200 rows. I can get all the data I want and open up an outlook appointment and even add an attachment. I am having issues of trying to make the body of the text html (change some words to red and bold them). When I change the line ".Body = email_Msg & vbCrLf & vbCrLf & Signature", it doesn't allow any formatting. I am having some issues. Can you please help?

Matt



Sub Welcome_Note()

Dim sRange As Range
Dim sEndRow As Integer
Dim sFirst_Name As String
Dim sLast_Name As String
Dim sFull_Name As String
Dim sCAI As String
Dim sWhat_Hire As String
Dim sJob_Type As String
Dim sJob_Title As String
Dim sStart_Date As String
Dim sPersonal_Email As String
Dim sSupervisor As String
Dim sFileName As String

sFileNameZip = "C:\Users\Help.xls"

Dim OutApp As Object
Dim OutMail As Object

Set sRange = ActiveCell
sEndRow = sRange.Row

sFirst_Name = ActiveSheet.Range("N" & sEndRow)
sLast_Name = ActiveSheet.Range("O" & sEndRow)
sFull_Name = sFirst_Name & " " & sLast_Name
sCAI = ActiveSheet.Range("Q" & sEndRow)
sWhat_Hire = ActiveSheet.Range("R" & sEndRow)
sJob_Type = ActiveSheet.Range("S" & sEndRow)
sJob_Title = ActiveSheet.Range("T" & sEndRow)
sStart_Date = ActiveSheet.Range("V" & sEndRow)
sPersonal_Email = ActiveSheet.Range("AC" & sEndRow)
sSupervisor = ActiveSheet.Range("AD" & sEndRow)


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

email_Msg = "<BHello " & sFirst_Name & ":" & vbCrLf & vbCrLf & "Congratulations and welcome to the Big A Team. My name is Michael "
email_Msg = email_Msg & "and I will assist you. In the unlikely event I am out of the office on your first day, please "
email_Msg = email_Msg & "contact my back up Jennifer. Your key information is below:" & vbCrLf & vbCrLf




email_Msg = email_Msg & "First Day Itinerary:" & vbCrLf & "8:00 am - Meet at the 1500 Louisiana Main Lobby Security Desk "
email_Msg = email_Msg & "(ask the security to contact me)" & vbCrLf & "8:00 am - Obtain a Smartbadge and Activate" & vbCrLf
email_Msg = email_Msg & "9:00 am - Complete administrative items, e.g.., Direct Deposit, travel and expense" & vbCrLf
email_Msg = email_Msg & "11:30 am - Lunch" & vbCrLf & "12:45 am - Continue administrative" & vbCrLf
email_Msg = email_Msg & "1:00 pm - I-9 verification (please bring two forms of U.S. identification)" & vbCrLf
email_Msg = email_Msg & "2:00 pm - Review Learning Management System (LMS) - Analiza Mckewen" & vbCrLf
email_Msg = email_Msg & "4:30 pm - End of first day" & vbCrLf & vbCrLf
email_Msg = email_Msg & "Hotels:" & vbCrLf & "Crown Plaza" & vbCrLf & "300 Anywhere St" & vbCrLf & "Houston, TX 77002" & vbCrLf & "(713) 888-8888" & vbCrLf & vbCrLf
email_Msg = email_Msg & "Hyatt Downtown" & vbCrLf & "1200 Overthere St" & vbCrLf & "Houston, TX 77002" & vbCrLf
email_Msg = email_Msg & "(713) 888-8888" & vbCrLf & vbCrLf & "I look forward to meeting you!"



On Error Resume Next
With OutMail
.Recipients.Add "
.Subject = "Welcome" & sFull_Name
.Location = "420 Overthere St, Houston, TX 77002 (Security Desk / Ground Floor Lobby)"
.Start = sStart_Date & " 8:00:00 AM"
.Duration = 510
.AllDayEvent = "False"
.MeetingStatus = olMeeting
.Attachments.Add sFileNameZip
.Body = email_Msg & vbCrLf & vbCrLf & Signature
.Display 'or use .Send
End With



End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Appointment in Outlook [email protected] Excel Programming 1 March 6th 09 05:26 AM
Automatically create outlook appointment Alarmbloke Excel Discussion (Misc queries) 0 March 12th 06 08:47 PM
Macro to create a Outlook Appointment from excel cell data Alarmbloke Excel Programming 1 January 27th 06 03:49 PM
Create a button in excel that can open an outlook appointment? Movieman Excel Worksheet Functions 1 July 15th 05 12:20 AM
make appointment in outlook and send email reminder - all data in excel 2000 DL[_3_] Excel Programming 2 August 5th 03 11:08 PM


All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"