Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / June 2005

Tip: Looking for answers? Try searching our database.

Show New Mail Desktop Alert indicates "HTML <end>"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim - 29 Jun 2005 16:34 GMT
When I send an Email via vbScript formatted as HTML, the Outlook New Mail
Desktop Alert indicates "HTML <end>" rather than the body of the Email.

How can I get the Alert to indicate the body of the Email.

Thanks in advance,

Tim

Option Explicit

Dim sFrom, sTo, sSubject, sBody
sFrom = "tbs2@pge.com"
sTo="tbs2@pge.com"
sSubject="Subject"
sBody="This is the Body line 1<br>"
sBody=sBody & vbcrlf & "This is the Body line 2<br>"
sBody=sBody & vbcrlf & "This is the Body line 3<br>"
sBody=sBody & vbcrlf & "This is the Body line 4<br>"
sBody=sBody & vbcrlf & "This is the Body line 5<br>"
sBody=sBody & vbcrlf & "This is the Body line 6<br>"
Mail sFrom, sTo, sSubject, sBody
WScript.Echo "Complete"

Function Mail(sFrom, sTo, sSubject, sBody)
Dim oCon, oMsg
Set oMsg = CreateObject("CDO.Message")
Set oCon = CreateObject ("CDO.Configuration")
With oCon
 .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mailhost.pge.com"
 .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")  
= 25    'SMTP port
 .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2    
         'CDO Port
 
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60    'Timeout
 .Fields.Update                                                            
     'Update the CDOSYS Configuration
End With
Set oMsg.Configuration = oCon
With oMsg
 .From = sFrom
 .To = sTo
 .Cc = ""
 .Subject = sSubject
 .TextBody="HTML"       'E-mail body format (HTMLBody=HTML TextBody=Plain)
 .HTMLBody = sBody
 .Send                                                                      
      'Send the e-mail
End With
Set oMsg = Nothing                                                          
     'Close the server mail object
Set oCon = Nothing
End Function

Signature

Tim Shaffer

Sue Mosher [MVP-Outlook] - 29 Jun 2005 17:11 GMT
Put the text you want to display into TextBody, which is what the desktop alert shows.

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> When I send an Email via vbScript formatted as HTML, the Outlook New Mail
> Desktop Alert indicates "HTML <end>" rather than the body of the Email.
[quoted text clipped - 51 lines]
> Set oCon = Nothing
> End Function
Tim - 29 Jun 2005 17:48 GMT
Thanks that fixed that problem.
I have also noticed that some Emails have a ToolTip type indication when
the mouse is hovered above them in Outlook.
How do I set that?
Signature

Tim Shaffer

> Put the text you want to display into TextBody, which is what the desktop alert shows.
>
[quoted text clipped - 53 lines]
> > Set oCon = Nothing
> > End Function
Sue Mosher [MVP-Outlook] - 29 Jun 2005 18:23 GMT
There's nothing to set. Outlook pulls data from the item's properties, based on the arrangement of the current view.

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Thanks that fixed that problem.
> I have also noticed that some Emails have a ToolTip type indication when
[quoted text clipped - 58 lines]
>> > Set oCon = Nothing
>> > End Function
Tim - 29 Jun 2005 18:38 GMT
Thanks
Signature

Tim Shaffer

> There's nothing to set. Outlook pulls data from the item's properties, based on the arrangement of the current view.
>
[quoted text clipped - 61 lines]
> >> > Set oCon = Nothing
> >> > End Function
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.