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 and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Calendar looping through the current month?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 8th 06, 01:21 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Calendar looping through the current month?

See http://www.outlookcode.com/d/finddate.htm for examples of how to use it to return items in a date range.

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


"Michael Bauer" wrote in message ...
Am Wed, 8 Feb 2006 14:27:56 +1100 schrieb Sydney:


You can use the Restrict function to get a particular range.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --

Hi All

From Word XP, I am successfully using this code that i found on the net.
It loops through the calendar items and warns when a particular subject is
found. The problem is, it searches the entire calendar going back 2

years.

Is it possible to get this to loop through the curent month or current

week?
Thanks in advace

Sub GetAppt()

Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim olFldr As MAPIFolder
Dim olApt As AppointmentItem
Dim myDate As Date

myDate = Date ' test

Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set olFldr = olNs.GetDefaultFolder(olFolderCalendar)


For Each olApt In olFldr.Items
If olApt.Subject = "test" Then
MsgBox "yes"
Debug.Print olApt.Subject, Format(olApt.Start, "mm/dd/yy")
End If

Next olApt

Set olApt = Nothing
Set olFldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

End Sub

 




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
I want the calendar month view to open w/ current week on top divi Outlook - Calandaring 1 February 13th 06 09:22 PM
31 day month does not startup on current date BobM Outlook - Calandaring 1 February 1st 06 12:52 AM
Outlook Calendar Month-view should show TODAY, not "1st of month" jgould3141 Outlook - Calandaring 6 January 31st 06 10:58 PM
All calendar events display on the current day JEM-Germany Outlook - Calandaring 0 January 23rd 06 03:30 PM
Need a shortcut or icon to see the current calendar month Tom B Outlook - Calandaring 4 January 8th 06 05:37 PM


All times are GMT +1. The time now is 02:00 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.