Using the outlook object model I can create an email and apply the HTMLBody property to change fonts / colors in my code like so:
VB Code:
Set EmailApp = CreateObject("Outlook.Application") 'using the outlook object Set NameSpace = EmailApp.GetNamespace("MAPI") Set EmailSend = EmailApp.CreateItem(0) EmailSend.Subject = "SOMT Updated Deliverables" EmailSend.HTMLBody = "<HTML><CENTER><FONT FACE=ARIAL SIZE=3 COLOR=BLUE><B>JAK - SOMT</B></FONT><BR> <FONT FACE=ARIAL SIZE=3 COLOR=RED><I>Deliverables Updated!</I></FONT></CENTER><BR><FONT FACE=ARIAL SIZE=2>The following task was assigned to you: " & rsTask!Task & ". The SOMT Tracking ID of this Service Order is:<B> " & rsTask!RecordID & "</B><BR><BR>" & _ "Your deliverables have been recently updated to the following: " & "<BR><UL>" Do While Not rsSubTask.EOF EmailSend.HTMLBody = EmailSend.HTMLBody & "<LI><I>" & rsSubTask!DeliverableDescription & "</I></LI><BR>" rsSubTask.MoveNext Loop EmailSend.HTMLBody = EmailSend.HTMLBody & Chr(13) & Chr(13) & "</UL>Thank You - <FONT COLOR=BLUE><B>JAK SOMT</B></FONT><BR><BR>Questions, Comments, or Concerns? Contact the <A HREF=mailto:[email protected]>SOMT-Admin</A></FONT></HTML>" EmailSend.Recipients.Add (rsTask!RespPerson & "@tkt-jakusa.thyssenkrupp.com") EmailSend.Send MsgBox "An e-mail has been sent to " & rsTask!RespPerson & " with their updated Deliverables.", vbInformation, "E-Mail Sent"
Fine and dandy...if I use the outlook object model and create a task: i.e:
VB Code:
Set NameSpace = EmailApp.GetNamespace("MAPI") Set EmailSend = EmailApp.CreateItem(3) '3 is a task
There is no HTMLBody...and the text remains plain. The thing is I need to be able to use bold only on some of the text in the task.
How can I use Bold only in some portions of the task if there is no HTMLBody property?
Thanks,
Jon




Reply With Quote