WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

.Restrict a Contact folder using the LastModificationTime

 
   Home -> Office -> Programming VBA RSS
Next:  Opening many shared calendars fails  
Author Message
Thatch

External


Since: Dec 13, 2006
Posts: 33



(Msg. 1) Posted: Tue May 27, 2008 5:21 pm
Post subject: .Restrict a Contact folder using the LastModificationTime
Archived from groups: microsoft>public>outlook>program_vba (more info?)

I'm trying to use the .restrict function in Outlook to find out the latest
batch of contacts that have been updated on a contact folder. However, this
works if you only use the date. If you use a time with the date, it just does
not work.
For example:
oContactsUpdated = oContacts.Items.Restrict("[LastModificationTime] >
'5/5/2008')
This call works and returns all the contacts that have been modified
after 5/5/2008. However, if you want to finetune the restriction by adding
the time,
it fails. For example, I want to find out all the contacts that have been
modified after 2pm on 5/5/2008. i.e.
oContactsUpdated = oContacts.Items.Restrict("[LastModificationTime] >
'5/5/2008 14:00:00')

That call returns 0, no matter what time I put. I have tried #5/5/2008
14:00:00# and that fails also.

Is there a way to use .Restrict on a date field with date and time that
works??
Back to top
Login to vote
JP

External


Since: Nov 20, 2007
Posts: 556



(Msg. 2) Posted: Tue May 27, 2008 5:43 pm
Post subject: Re: .Restrict a Contact folder using the LastModificationTime [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I think if you drop the "seconds" portion of the time value, it should
work.

i.e.

14:00

not

14:00:00


--JP

On May 27, 8:21 pm, Thatch <Tha....DeleteThis@discussions.microsoft.com> wrote:
> I'm trying to use the .restrict function in Outlook to find out the latest
> batch of contacts that have been updated on a contact folder. However, this
> works if you only use the date. If you use a time with the date, it just does
> not work.
> For example:
> oContactsUpdated = oContacts.Items.Restrict("[LastModificationTime] >
> '5/5/2008')
> This call works and returns all the contacts that have been modified
> after 5/5/2008. However, if you want to finetune the restriction by adding
> the time,
> it fails. For example, I want to find out all the contacts that have been
> modified after 2pm on 5/5/2008. i.e.
> oContactsUpdated = oContacts.Items.Restrict("[LastModificationTime] >
> '5/5/2008 14:00:00')
>
> That call returns 0, no matter what time I put. I have tried #5/5/2008
> 14:00:00# and that fails also.
>
> Is there a way to use .Restrict on a date field with date and time that
> works??
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET