A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Custom Email Form



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 23rd 06, 03:35 AM posted to microsoft.public.outlook.program_forms
BlockNinja
external usenet poster
 
Posts: 4
Default Custom Email Form

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.
  #2  
Old March 31st 06, 05:01 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Custom Email Form

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.

--
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

"BlockNinja" wrote in message ...
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.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom form Charlie Outlook - Using Contacts 5 March 8th 06 05:24 PM
Custom form Melbin Outlook - Using Forms 1 January 24th 06 01:17 PM
I send an Outlook custom form, but a std. form displays? Sue Mosher [MVP-Outlook] Outlook - Using Forms 0 January 20th 06 08:41 PM
Change Default Send email form to Custom Send email Form Sue Mosher [MVP-Outlook] Outlook - Using Forms 0 January 20th 06 06:33 PM
Cannot programmatically open custom message in custom form ms Outlook - Using Forms 1 January 20th 06 04:01 PM


All times are GMT +1. The time now is 08:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.