Hola amigos, que tal??
Estoy creando una aplicacion que me extraiga todos los datos adjuntos de mi correo que tengo en Outlook. Nada mas que me sale el error de User-defined type not defined.
Espero que alguien pueda decirme que tengo que hacer para componerlos y que corra el codigo. Aqui se los muestro y tambien les adjunto el archivo (Muchas gracias):
Private Sub Command1_Click()
On Error Resume Next
Me.lblExtract.Caption = ""
Me.lstExtractionStatus.Enabled = True
Me.lstExtractionStatus.Clear
Dim oApp As Outlook.Application
Dim oNameSpace As NameSpace
Dim oFolder As MAPIFolder
Dim oMailItem As Object
Dim sMessage As String
Set oApp = New Outlook.Application
Set oNameSpace = oApp.GetNamespace("MAPI")
'Set oFolder = oNameSpace.GetDefaultFolder(olFolderInbox)
'oNameSpace.PickFolder
'msgbox onamespace.PickFolder.
Set oFolder = oNameSpace.PickFolder
Dim exCnt As Integer
Me.Command1.Enabled = False
For Each oMailItem In oFolder.Items
With oMailItem
If oMailItem.Attachments.Count > 0 Then
oMailItem.Attachments.Item(1).SaveAsFile Dir1.Path & "\" & _
oMailItem.Attachments.Item(1).Parent & "~~" & _
oMailItem.Attachments.Item(1).FileName
DoEvents
lstExtractionStatus.AddItem (oMailItem.Attachments.Item(1).Parent)
exCnt = exCnt + 1
lblExtract.Caption = exCnt & " extracted"
End If
End With
Next oMailItem
Set oMailItem = Nothing
Set oFolder = Nothing
Set oNameSpace = Nothing
Set oApp = Nothing
Me.Command1.Enabled = True
End Sub
Private Sub Drive1_Change()
Me.Dir1.Path = Drive1.Drive
End Sub