This is a task form that the techs fill out and it is sent to the Service
Desk. On this task form there are two custom tabs. The Info tab is the tab
that the techs also fill out the fields (description, who, why, etc). When
the Service Desk receives it, they click on the third tab (Service Desk Only)
and click on the Service Desk button. This generates the email that will go
to the clients. The Service Desk is to read the message and if they
understand it, send it out to the clients ... Service Desk being the first
point of contact. We want to keep the format (green font when required) and
also keep an internet link if one was typed by the tech. Here is the entire
code. I was using tables with HTML strings to allow for the green font.
***********
Function Item_Open()
Dim objTab1
Dim objTab2
Set objTab1 = Item.GetInspector.ModifiedFormPages("Information")
Set txtWhen = objTab1.Controls("txtWhen")
Set txtDescription = objTab1.Controls("txtDescription")
Set txtWhy = objTab1.Controls("txtWhy")
Set txtWhat = objTab1.Controls("txtWhat")
Set txtOther = objTab1.Controls("txtOther")
Set txtContact = objTab1.Controls("txtContact")
Set objTab2 = Item.GetInspector.ModifiedFormPages("Service Desk Only")
Set txtSubject = objTab2.Controls("txtSubject")
Set cmdSDesk = objTab2.Controls("cmdSDesk")
Set objTab1 = Nothing
Set objTab2 = Nothing
End Function
Sub cmdSDesk_Click()
Set objNewEmail = Application.CreateItem(0)
Set objTab1 = Item.GetInspector.ModifiedFormPages("Information").Controls
Set objTab2 = Item.GetInspector.ModifiedFormPages("Service Desk
Only").Controls
tmpWhen = objTab1("txtWhen")
tmpWhen = Replace(tmpWhen, Chr(13), "<br>")
tmpDescription = objTab1("txtDescription")
tmpDescription = Replace(tmpDescription, Chr(13), "<br>")
tmpWhat = objTab1("txtWhat")
tmpWhat = Replace(tmpWhat, Chr(13), "<br>")
tmpWhy = objTab1("txtWhy")
tmpWhy = Replace(tmpWhy, Chr(13), "<br>")
tmpOther = objTab1("txtOther")
tmpOther = Replace(tmpOther, Chr(13), "<br>")
tmpContact = objTab1("txtContact")
tmpContact = Replace(tmpContact, Chr(13), "<br>")
strHTML = "<table>"
if Len(tmpWhen) > 1 then
strHTML = strHTML & "<tr><td><strong><font face=arial color='green'
size=-1>When:</strong></font></tr></td>"
strHTML = strHTML & "<tr><td><font face=arial color='black'
size=-1><textformat>"
strHTML = strHTML & tmpWhen
strHTML = strHTML & "</textformat></td></tr>"
strHTML = strHTML & "<tr><td></td></tr>"
end if
if Len(tmpDescription) > 1 then
strHTML = strHTML & "<tr><td><strong><font face=arial color='green'
size=-1>Description:</strong></font></tr></td>"
strHTML = strHTML & "<tr><td><font face=arial color=black
size=-1><textformat>"
strHTML = strHTML & tmpDescription
strHTML = strHTML & "</textformat></td></tr>"
strHTML = strHTML & "<tr><td></td></tr>"
end if
if Len(tmpWhat) > 1 then
strHTML = strHTML & "<tr><td><strong><font face=arial color='green'
size=-1>Who/What will be affected:</strong></font></td></tr></tr>"
strHTML = strHTML & "<tr><td><font face=arial color=black size=-1>"
strHTML = strHTML & tmpWhat
strHTML = strHTML & "</textformat></td></tr>"
strHTML = strHTML & "<tr><td></td></tr>"
end if
if Len(tmpWhy) > 1 then
strHTML = strHTML & "<tr><td><strong><font face=arial color='green'
size=-1>Why:</strong></td></tr></font>"
strHTML = strHTML & "<tr><td><font face=arial color=black size=-1>"
strHTML = strHTML & tmpWhy
strHTML = strHTML & "</textformat></td></tr>"
strHTML = strHTML & "<tr><td></td></tr>"
end if
if Len(tmpOther) > 1 then
strHTML = strHTML & "<tr><td><strong><font face=arial color='green'
size=-1>Other Information:</strong></td></tr></tr></font>"
strHTML = strHTML & "<tr><td><font face=arial color=black size=-1>"
strHTML = strHTML & tmpOther
strHTML = strHTML & "</textformat></td></tr>"
strHTML = strHTML & "<tr><td></td></tr>"
end if
strHTML = strHTML & "<tr><td><strong><font face=arial color='green'
size=-1>Any problems/concerns you may contact:</strong></td></tr></font>"
strHTML = strHTML & "<tr><td><font face=arial color='black' size=-1>"
strHTML = strHTML & tmpContact
strHTML = strHTML & "</textformat></td></tr>"
strHTML = strHTML & "<tr><td></td></tr>"
With objNewEmail
.bcc = objTab1("test")
.Subject = objTab2("txtSubject")
.HTMLBody = strHTML
objNewEmail.Display
End With
Set objNewEmail = Nothing
Set objTab1 = Nothing
Set objTab2 = Nothing
End Sub
****************
Thanks.
Wanda