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

Outlk 2k3 Script: Find and findNext use



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 21st 06, 10:24 AM posted to microsoft.public.outlook.program_vba
news.microsoft.com
external usenet poster
 
Posts: 65
Default Outlk 2k3 Script: Find and findNext use

Hi all,

I try to use the find funtion comapring 2 properties

I want to add to my listbox all items that mileage
is greater than 50000 at a specific day then pb is
that ceationtime is like dd/mm/yyyy hh:mm:ss
so i want to use date() function to convert the
creationtime to dd/mm/yyyu

item.mileage Var1 and the item.creationtime= Var2

set myItem = Items.Find("[mileage] """ & myvar1 & """ and
date(myitem.creationtime) = """ & myVar2"""")

I tryed many sintax but no one work

tks for help


Ads
  #2  
Old November 21st 06, 02:44 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlk 2k3 Script: Find and findNext use

The Date function either sets or retrieves the system date. It doesn't do
anything close to what you want to do. You also can't use seconds in a Find
or Restrict.

The Help on Items.Restrict lists all the properties you can't use for a
filter and shows some pretty good examples of filters you can use. For what
you want it probably would be something like:

sFilter = "[Mileage] " & Var1
sFilter = sFilter & " And [CreationTime] = '" & Format(Var2, "ddddd h:nn
AMPM") & "'"
Set myItem = Items.Find(sFilter)

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"news.microsoft.com" wrote in message
...
Hi all,

I try to use the find funtion comapring 2 properties

I want to add to my listbox all items that mileage
is greater than 50000 at a specific day then pb is
that ceationtime is like dd/mm/yyyy hh:mm:ss
so i want to use date() function to convert the
creationtime to dd/mm/yyyu

item.mileage Var1 and the item.creationtime= Var2

set myItem = Items.Find("[mileage] """ & myvar1 & """ and
date(myitem.creationtime) = """ & myVar2"""")

I tryed many sintax but no one work

tks for help



 




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
Outlk 2k3 script: How to get the name of the month news.microsoft.com Outlook and VBA 2 November 21st 06 02:35 PM
Outlk 2k3 : Publishing my form to all Outlook User bbnimda Outlook and VBA 3 November 20th 06 10:09 PM
Outlk 2k3 script: Tab in body Task "space to separate text" news.microsoft.com Outlook and VBA 1 November 17th 06 02:13 PM
Outlk 2k3 Script: Pb Using Find function Help plz!!! news.microsoft.com Outlook and VBA 1 November 15th 06 03:40 PM
Find......FindNext Junoon Outlook and VBA 3 June 16th 06 09:06 PM


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