[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 891
  • Last Modified:

Bold line of vba code message

In the code below an email is sent when a new project task in BCM for Outlook 2007 is created.

What I would like is for the last line, Please refer to/update task within BCM for more information/to log changes. to be in bold

Also is there the possibility of having it or other text at a different font size?

Thanks Ed.
'This emails the task contents to the assigned user. version 1.0
 
Option Explicit
Dim WithEvents inspector As inspector
Dim WithEvents project As TaskItem
Dim self As ProjectWrapper
Dim originalProjectSubject As String
 
Public Sub Init(anInspector As inspector)
    Set self = Me
    Set inspector = anInspector
    Set project = inspector.CurrentItem
End Sub
 
Private Sub inspector_Close()
    Set self = Nothing
End Sub
 
Private Sub project_Open(Cancel As Boolean)
    originalProjectSubject = project.UserProperties.Item("ParentDisplayName").Value
End Sub
 
Private Sub project_Write(Cancel As Boolean)
    Dim projectSubject As String
    projectSubject = project.UserProperties.Item("ParentDisplayName").Value
    If originalProjectSubject <> projectSubject Then
        originalProjectSubject = projectSubject
    Dim mail As MailItem
          Set mail = Application.CreateItem(olMailItem)
            mail.Subject = "Task Assigned: " & project.Subject & " for project " & projectSubject
            mail.Body = project.Owner & " has assigned you: " & project.Subject & " for project " & projectSubject & Chr(10) & "To be completed by " & project.DueDate & Chr(10) & "Comments: " & project.Body & Chr(10) & Chr(10) & "Please refer to/update task within BCM for more information/to log changes."
         mail.To = "edmacey@gmail.com"
        mail.Send
    End If
End Sub

Open in new window

0
edmacey
Asked:
edmacey
  • 3
1 Solution
 
DanielWillmottCommented:
Try adding this...
mail.HTMLBody = project.Owner & " has assigned you: " & project.Subject & " for project " & projectSubject & Chr(10) & "To be completed by " & project.DueDate & Chr(10) & "Comments: " & project.Body & Chr(10) & Chr(10) & "<b>Please refer to/update task within BCM for more information/to log changes.</b>"

Open in new window

0
 
DanielWillmottCommented:
You may also need to add:
mail.BodyFormat = olFormatHTML
0
 
DanielWillmottCommented:
Any luck Ed?
0
 
edmaceyAuthor Commented:
Sorry Daniel, I thought that I had accepted this yesterday with the comments "Fantastic, gives me much more functionality this way." Thanks Ed.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now