H
Herbert Gottlieb
Hello,
i have problems with the use of find:
Dim iFItem As Integer
Dim OlApp As Outlook.Application, olMail As Outlook.MailItem
Dim strSenderName As String, strCreationTime As String, strReceivedTime As
String, strSubject as String
Set olApp = Outlook.Application
Set olMail = ActiveExplorer.Selection.Item(1)
strSenderName = olMail.SenderName
strCreationTime = olMail.CreationTime
strReceivedTime = olMail.ReceivedTime
strSubject= olMail.Subject
Gosub GetSubfolder 'Find Archivfolder 'Returns ->Nr: iFItem, or
Exit
With olApp.ActiveExplorer.CurrentFolder
Set olMail = .Folders.Item(iFItem).Items.Find("[SenderName] = "
& Chr(34) & _
strSenderName & Chr(34))
Debug.Print "40", olMail.SenderName, olMail.Subject,
olMail.CreationTime, olMail.ReceivedTime
End With
Set olApp=Nothing
Set olMail=Nothing
My problems:
If i use 1)
.....Find("[Subject] = " & chr(34) & strSubject & chr(34)):
a) it finds the first Subject, it doesn't matter if it is a forewarded mail
(WG: in german; FWD: in english version) or not
b) if the selected mail is an forwarded mail ( WG: or FWD: at the beginning
of the subject), so i get an error at the search;
2)searching by date and time: i was not able to search like
.....Find("[ReceivedTime] = " & chr(34) & strReceivedTime & chr(34)) it
doesn't work
also i've formated in different ways and canceld the seconds
Thanks for help
Herbert
i have problems with the use of find:
Dim iFItem As Integer
Dim OlApp As Outlook.Application, olMail As Outlook.MailItem
Dim strSenderName As String, strCreationTime As String, strReceivedTime As
String, strSubject as String
Set olApp = Outlook.Application
Set olMail = ActiveExplorer.Selection.Item(1)
strSenderName = olMail.SenderName
strCreationTime = olMail.CreationTime
strReceivedTime = olMail.ReceivedTime
strSubject= olMail.Subject
Gosub GetSubfolder 'Find Archivfolder 'Returns ->Nr: iFItem, or
Exit
With olApp.ActiveExplorer.CurrentFolder
Set olMail = .Folders.Item(iFItem).Items.Find("[SenderName] = "
& Chr(34) & _
strSenderName & Chr(34))
Debug.Print "40", olMail.SenderName, olMail.Subject,
olMail.CreationTime, olMail.ReceivedTime
End With
Set olApp=Nothing
Set olMail=Nothing
My problems:
If i use 1)
.....Find("[Subject] = " & chr(34) & strSubject & chr(34)):
a) it finds the first Subject, it doesn't matter if it is a forewarded mail
(WG: in german; FWD: in english version) or not
b) if the selected mail is an forwarded mail ( WG: or FWD: at the beginning
of the subject), so i get an error at the search;
2)searching by date and time: i was not able to search like
.....Find("[ReceivedTime] = " & chr(34) & strReceivedTime & chr(34)) it
doesn't work
also i've formated in different ways and canceld the seconds
Thanks for help
Herbert