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

Restrict with equal on German computers



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 3rd 07, 08:38 AM posted to microsoft.public.outlook.program_vba
Peter Marchert
external usenet poster
 
Posts: 116
Default Restrict with equal on German computers

Thanks for your answer, Ken.

I tried several formats and it works with the following:
Format("8/25/07", "ddddd h:nn")

I guess because German people does not have AM/PM :-)

Peter

--
Infos, workshops & soft-
ware for your Outlook®:
www.outlook-stuff.com


On 2 Aug., 15:02, "Ken Slovak - [MVP - Outlook]"
wrote:
I'd guess it's the date format, but I don't have a German system here to
test on. I'd try using the format string for long date using your system
settings or maybe General Date format. Empirically I'd just use the VBA
project to set up a filter string that works (hard-coded) and then replicate
that date format with the Format function.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm

"Peter Marchert" wrote in message

ups.com...
Hello,

I have a restrict problem on german computers only.

The following code works fine on an english system:

Sub Test1()

Dim objCalendar As Outlook.MAPIFolder
Dim objAppis As Outlook.Items
Dim strFilter As String

Set objCalendar =
Outlook.Session.GetDefaultFolder(olFolderCalendar)

strFilter = "[Start] = '" & Format("8/25/07", "ddddd h:nn AMPM") &
"'"

Set objAppis = objCalendar.Items.Restrict(strFilter)

Debug.Print objAppis.Count

End Sub

All items with the specified start date are returned. The same code on
a german system returns no items ("objAppis.Count" is always zero).

This code:

Sub Test2()

Dim objCalendar As Outlook.MAPIFolder
Dim objAppis As Outlook.Items
Dim strFilter As String

Set objCalendar =
Outlook.Session.GetDefaultFolder(olFolderCalendar)

strFilter = "[Start] '" & Format("8/24/07", "ddddd h:nn AMPM") &
"'" & _
"AND [Start] '" & Format("8/26/07", "ddddd h:nn AMPM") & "'"

Set objAppis = objCalendar.Items.Restrict(strFilter)

Debug.Print objAppis.Count

End Sub

returns all items between 8/25/07 and 8/26/07. So I`m afraid this is a
bug in Outlook or only a date formatting problem.

Thanks in advanced for any help!

Peter

--
Infos, workshops & soft-
ware for your Outlook®:www.outlook-stuff.com



 




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
Treating multiple contact folders as equal Tolgan Outlook - Using Contacts 3 May 28th 07 08:07 PM
Printing a 7 equal day calendar rpaul Outlook - Calandaring 1 January 19th 07 03:44 AM
why is my outlook in german? [email protected] Outlook - Installation 1 December 21st 06 06:31 PM
print style for month equal day size AlanC Outlook - Calandaring 0 July 12th 06 03:48 PM
I want to prepare a report of all fields not equal to zero what do you mean by display name Outlook and VBA 2 March 28th 06 08:30 PM


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