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 Forms / March 2006

Tip: Looking for answers? Try searching our database.

Custom Email Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BlockNinja - 23 Mar 2006 03:35 GMT
I am trying to design a form that looks something would look something like
this:

Subject:
"*** Delinquency Comparison *** - as of " &
format(dateadd("d",-1,now),"Short Date")

To:
"blah, blahblah; lastname, firstname" (a predefined list of names)

Body:
"All:" & vbcrlf & _
"The report is now available at: " & vbcrlf & _
"\\networkcomp\drive\public\reporting\" &
format(dateadd("d",-1,now),"yyyymmdd") & "_DelinquencyComparison.xls" &
vbcrlf & vbcrlf & _
"Thank you"

Any ideas on how I might do something like this as a "one-touch" operation
in Outlook so that I can click a single button and send an email like this
out every day? Sorry for my code if it's wrong, I'm more acquainted with
Access VBA than Outlook.
Sue Mosher [MVP-Outlook] - 31 Mar 2006 16:01 GMT
If you want to do it as a custom form, put the code to set message properties in the Item_Open event handler of your custom form:

Function Item_Open()
   newDate = dateadd("d",-1,now)
   Item.Subject = "*** Delinquency Comparison *** - as of " & _
               FormatDateTime(newDate,vbShortDate)
   Item.To = "blah, blahblah; lastname, firstname"
   newDate =
   Item.Body = "All:" & vbcrlf & _
       "The report is now available at: " & vbcrlf & _
       "\\networkcomp\drive\public\reporting\" & _
       yyyymmdd(newDate) & "_DelinquencyComparison.xls" & _
       vbcrlf & vbcrlf & "Thank you"
End Function

Function yyyymmdd(anyDate)
   If IsDate(anyDate) Then
       yyyymmdd = Year(anyDate) & _
           IIf(Month(anyDate) < 10, "0", "") & _
           Month(anyDate) & _
           IIf(Day(anyDate) < 10, "0", "") & _
           Day(anyDate)
   End If
End Function

Note the use of a custom function to work around the fact that Format() is not available in VBScript.

You'll need to publish the form in order for the code to run.

You could also use VBA code to generate the message with Application.CreateItem and then set its properties.

Signature

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

>I am trying to design a form that looks something would look something like
> this:
[quoted text clipped - 18 lines]
> out every day? Sorry for my code if it's wrong, I'm more acquainted with
> Access VBA than Outlook.
 
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.