More Outlook Resource Sites

Microsoft Developer Network (MSDN)

FAQs and other general resources

Login

login
password
Remember me

You will need to register and log in if you want to download the source code for the Microsoft Outlook Programming book. The forums and code sharing areas are open to both registered and non-registered visitors.

share code 09-Sep-2010 06:07

Looking for help with Outlook programming projects — VSTO, add-ins, VBA, custom Outlook forms, etc.? You′ve come to the right place!

NEW! >> Subscribe to this site via RSS. For more RSS options, see the complete list of feeds on our main news page.

 

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:
1st row, 1st col 1st row, 2nd col
2nd row, 1st col 2nd row, 2nd col
You can add formatting to the basic structure using standard HTML tags and attributes.
Date: 23-Oct-2002  06:42
Code level: beginner
Code area: Basic Outlook
Posted by: Sue Mosher
Body:
All 99comments
Page [ 1 2 3 4 5 6 7 8 9 10 Next >>  
  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>

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



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

 
  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 ...?
  03-Mar-2003  18:18   
Roger, try changing the date format from "dd mmm yyyy" to "ddddd" -- I've seen that help sometimes.
  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!
  12-Apr-2003  16:53   
How would you suggest using GetDefaultFolder to look at a Public Calendar instead of the user's local calendar?
  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