Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim MyOutlook As Outlook.Application
- Dim Msg As Outlook.MailItem
- Dim x As Namespace
- Dim Row As Integer
- Dim Path As String
- Dim FileList() As Variant
- Set MyOutlook = New Outlook.Application
- Set x = MyOutlook.GetNamespace("MAPI")
- Set Msg = Nothing
- MsgBox "Step1"
- Path = GetFolder()
- If Path = "" Then
- MsgBox "No folder selected"
- Exit Function
- End If
- MsgBox "Step2"
- Path = Path + ""
- MsgBox Path
- FileList = GetFileList(Path + "*.msg")
- MsgBox "Step3"
- Row = 1
- MsgBox "Step4"
- While Row <= UBound(FileList)
- MsgBox "Step5"
- Set Msg = x.OpenSharedItem(Path + FileList(Row))
- MsgBox "Step6" & Msg.Body
- Row = Row + 1
- MsgBox "Step7" & Msg.Body
- Wend
- MsgBox "Step8"
- MsgBox "file extrated=" + Msg.Body
- ExtractMsg = Msg
Add Comment
Please, Sign In to add comment