| Code level: beginner Code area: Basic Outlook Printer Friendly Version | ||||||
| Title: Sending a mail message with today's appointments | ||||||
Description:
Tnis code generates an HTML-format mail message containing a list of today's appointments. It may look complicated, but it uses nothing but basic methods and properties -- mainly Items.Restrict (see related article at http://www.slipstick.com/dev/finddate.htm), MailItem.HTMLBody, and the properties of an AppointmentItem.
In case you're not familiar with HTML tables, the basic syntax -- which the AddApptRow routine helps to construct -- is:
|
||||||
| Date: 23-Oct-2002 06:42 | ||||||
| Code level: beginner | ||||||
| Code area: Basic Outlook | ||||||
| Posted by: Sue Mosher | ||||||
| Body: | ||||||
| Page [ 1 2 3 4 5 6 7 8 9 10 Next >> ] | ||
|
|
webmaster
24-Oct-2002 06:42
Let's try that again. Here's the raw HTML to represent a table: <table> <tr> <td>1st row, 1st col</td> <td>1st row, 2nd col</td> </tr> <tr> <td>2nd row, 1st col</td> <td>2nd row, 2nd col</td> </tr> </table> |
|
|
|
Chris Searle
24-Oct-2002 19:23
Great & very useful Thanks, hope you can help, I've tried to change to point to my journal folder, as it would be very useful to capture this data, but very new to this so unsure which bits need amending (have ordered the book & look forward to it's arrival) Thanks Chris |
|
|
|
Sue Mosher
15-Nov-2002 16:07
Several things to change: 1. Declare a variable for each journal item you'll process: Dim objJournal As Outlook.JournalItem 2. Get the Journal folder instead of the Calendar folder: Set colCal = objNS.GetDefaultFolder(olFolderJournal).Items 3. Leave out the IncludeRecurrences statement, because journal items are not recurring. 4. Modify the AddApptRow to build the table from the JournalItem properties that you want to use. You can look up the property names in the Object Browser -- Press Alt+F11 to get into the VBA environment, then F2 for the Object Browser. The object you want to look at is JournalItem. Have fun! |
|
|
|
Barb
03-Dec-2002 10:24
I am new at this. Where do I put this code? In a button or on a web page? Thanks. |
|
|
|
Sue Mosher
07-Jan-2003 22:08
Hi, Barb. Welcome! The fact that this code has typed variable declarations (e.g. Dim objApp As Outlook.Application) is the tipoff that this is VBA or VB code. If you add it to VBA in Outlook (Alt+F11), you can run it from the Tools | Macros dialog or customize the toolbar or menu to add a command to run the MailTodaysAppts macro. If you're totally new to VBA, the article at http://www.win2000mag.com/Articles/Index.cfm?ArticleID=21522 should give you the essentials. |
|
|
|
Roger Sturgiss
20-Feb-2003 11:28
I'm new to programming but I copied the code above into a new module and ran the macro. First I got an error on the very last line of the code - I changed it to End Function and got my next error - type mismatch or the value "21 Feb 2003 12:00 AM" in the condition is not valid. I'm on NT4 w/Outlook2000 on Exchange 5.5. Is this a date time formatting problem in the code or due to my system settings or ...? |
|
|
|
Sue Mosher
03-Mar-2003 18:18
Roger, try changing the date format from "dd mmm yyyy" to "ddddd" -- I've seen that help sometimes. |
|
|
|
Anonymous
31-Mar-2003 15:28
I changed the "dd mmm yyyy" to "ddddd" and that did the trick. Thanks for a great site! I'll be buying the book soon! |
|
|
|
Bill
12-Apr-2003 16:53
How would you suggest using GetDefaultFolder to look at a Public Calendar instead of the user's local calendar? |
|
|
|
Bill
12-Apr-2003 17:08
I'm a beginner and managed to scrape this code together to reference a public folder. Is this the most efficient to call up the items?: Set colCal = objApp.GetNamespace("Mapi").GetFolderFromID("000000001A447390AA6611CD9BC800AA002FC45A03001CF93BFDCA3E8042888992CEFCEEACA2000000001F4B0000").Items |
|
| Page [ 1 2 3 4 5 6 7 8 9 10 Next >> ] | ||
| Post your comment name email |
