473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Finding an outlook appointment using ".find" fuction

I am writing an application to retrieve appointments from Outlook, I have the appointment items sorted by
"Start" field and now I want to find the first record which's "Start" value is later than now (future appointment

The relevant piece of my current code

Dim oCalendar As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFo lderCalendar
Dim oItems As Outlook.Items = oCalendar.Item
oItems.Sort("Start"
oItems.IncludeRecurrences = Tru
Dim oAppt As Outlook.AppointmentItem = oItems.Find("[Subject] = ""Flight, CO 0516 2:10pm"""

What is the syntax to replcae the ("[Subject] = ""Flight, CO 0516 2:10pm""") in the last line to reflect what I need
something like ".Find("[Start] >" & Now.ToString)" - which does not wor

Your help is greatly appriciate
Thanks
Ori :)
Nov 20 '05 #1
2 10053
Ori,
For a list of resources on using Outlook from VB.NET:
http://www.microeye.com/resources/res_outlookvsnet.htm

For help & information on programming Outlook (mostly VB6, some VB.NET):
http://www.outlookcode.com/

Some samples of using Outlook with VB.NET:
http://msdn.microsoft.com/office/def...OLOMwVBNET.asp

A sample COM Add-in for Outlook written in VB.NET:
http://msdn.microsoft.com/library/de...hatsNew2k3.asp
Did you check the online help for specifics on using dates with the Find
method?

It needs to be in the following (VBA) format:

sFilter = "[LastModificationTime] > '" & Format("1/15/99 3:30pm", "ddddd
h:nn AMPM") & "'"

Remember that you can still use the VBA/VB6 Format function in .NET so it
would be:

sFilter = "[LastModificationTime] > '" & Format(Now, "ddddd h:nn AMPM")
& "'"

or if you prefer (unchecked):

sFilter = "[LastModificationTime] > '" & Now.ToString("ddddd h:nn AMPM")
& "'"

Hope this helps
Jay

"Ori :)" <an*******@discussions.microsoft.com> wrote in message
news:4F**********************************@microsof t.com...
I am writing an application to retrieve appointments from Outlook, I have the appointment items sorted by "Start" field and now I want to find the first record which's "Start" value is later than now (future appointment)
The relevant piece of my current code:

Dim oCalendar As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFo lderCalendar) Dim oItems As Outlook.Items = oCalendar.Items
oItems.Sort("Start")
oItems.IncludeRecurrences = True
Dim oAppt As Outlook.AppointmentItem = oItems.Find("[Subject] = ""Flight, CO 0516 2:10pm""")
What is the syntax to replcae the ("[Subject] = ""Flight, CO 0516 2:10pm""") in the last line to reflect what I need ? something like ".Find("[Start] >" & Now.ToString)" - which does not work

Your help is greatly appriciated
Thanks !
Ori :)

Nov 20 '05 #2
Thanks Jay ! will give it a try ! :)
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: salem.ganzhorn | last post by:
#include <map> #include <iostream> using namespace std; int main( int argc, const char * argv ) {
1
by: P-O | last post by:
Hi! I want to open the "Find" window in MSIE to allow a user to find text on the page they are looking at (Ctrl+F). Any sggestions for the easiest possible way? /P-O
2
by: Praveen | last post by:
In the ISPF editor I am using, for a particullar PO Dataset I am getting the result of FIND statement narrowed down to the colums 48-56. i.e. if I give "FIND 'TO' ALL", the result I am getting as...
2
by: galsaba | last post by:
Is there a "Find" fucntion in Access? I found this is Excell Find (find_text, within_text, start_num). Where can i find a similar function is Access? galsaba
3
by: Rudy Ray Moore | last post by:
Hi guys, I often use the "Find" (aka CTRL-F) tool in "Visual Studio .net 2003 7.1 c++". I noticed that that dialog box does not go away when I perform a search (it stays on the screen). This...
2
by: Lenonardo | last post by:
Hi. I'm writing a VB.Net application to update multiple Excel Worksheets. I'm using late binding (i.e. all variables are objects + use createobject) I develop the application on an XP...
8
by: clyfish | last post by:
In cmd, I can use find like this. C:\>netstat -an | find "445" TCP 0.0.0.0:445 0.0.0.0:0 LISTENING UDP 0.0.0.0:445 *:* C:\> And os.system is OK....
1
by: C++ Newbie | last post by:
I want to recursively search for subdirectories containing filename1 only, but not filename1 & filename2. I tried using the following csh command but it doesn't work: find ./ -name d3hsp | sed...
3
by: =?ISO-8859-1?Q?Andreas_M=FCller?= | last post by:
Hi! (Python 2.2.3 if this is relevant :-) I have a list of objects with, lets say, the attributes "ID", "x" and "y". Now I want to find the index of list element with ID=10. Of course I can...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.