원하는대로 할 수 있습니다.
Option Compare Database
Private Sub Command0_Click()
Dim myNameSpace As Outlook.NameSpace
Dim myInbox As Outlook.Folder
Dim myDestFolder As Outlook.Folder
Dim myItems As Outlook.Items
Dim myItem As Object
Dim ol As Outlook.Application
Dim olns As Outlook.NameSpace
' Set the Application object.
Set ol = New Outlook.Application
' Set the Namespace object.
Set olns = ol.GetNamespace("MAPI")
Set myInbox = olns.GetDefaultFolder(olFolderInbox)
Set myItems = myInbox.Items
Set myDestFolder = myInbox.Folders("OverHere")
For Each myItem In myItems
If myItem.Class = olMail Then
If InStr(1, myItem.Subject, "Happy Birthday") > 0 Then
'Debug.Print "Found"
'Found = True
myItem.Move myDestFolder
End If
End If
Next myItem
While TypeName(myItem) <> "Nothing"
Set myItem = myItems.FindNext
Wend
End Sub
코드는 어디에 있습니까? 문제가 발생하면 무언가를 시도하고 질문하십시오. – Masoud