Rich Text Formatting

G

Guest

I have a form that sends out a message when a certain function is requested.
I want to make sure this message goes out in "rich text" format. What type
of coding do I need to have this happen?

Thanks.

Wanda
 
S

Sue Mosher [MVP-Outlook]

How does the form generate the message? Why is RTF critical?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

This is the code that generates the message:
With objNewEmail
.bcc = objTab1("test")
.Subject = objTab2("txtSubject")
.HTMLBody = strHTML
objNewEmail.Display
End With
****************
I used .HTMLBody = strHTML and don't know what to use for Rich Text. I
want the body of the message to hold a link to an internet address.

Thanks.

Wanda
 
S

Sue Mosher [MVP-Outlook]

I want the body of the message to hold a link to an internet address.

That is no reason to require RTF. HTML would be a much better choice. Is there more to it than that?

You didn't show how objNewEmail is created.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

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
 
S

Sue Mosher [MVP-Outlook]

So, there's no RTF involved at all, is there? The message is an HTML-format message. You just need to create the link the way you normally would in HTML:

<a href="http://www.theurl.com">http://www.theurl.com</a>
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

I have just added the notes to the form to add HTML code for the link in
their message and it works. I was just hoping that the techs would not have
to add the HTML code for the link .... it would just be automatic like when
you are sending a message and start typing WWW.???? (the link is enabled
immediately).

Not a biggy though ... I add the comments to the form and that will work.

Thanks.

Wanda
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top