Set olFld = olNsp.GetDefaultFolder(6)
I have maked this command but the code go in error:
Set olFld = olNsp.GetDefaultFolder(6).Folders("SRER ")
this is a part of my declation:
Code: Select all
Dim olApp As Object
Dim olNsp As Object
Dim olFld As Object
Dim olFld2 As Object
Dim olItm As Object
Dim olAtt As Object
Dim blnStart As Boolean
Dim TEST As Date, DATA_FILE As String
Dim strFilename As String
'http://windowssecrets.com/forums/showthread.php/122163-i-dont-know-is-possible....
On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
If olApp Is Nothing Then
Set olApp = CreateObject("Outlook.Application")
If olApp Is Nothing Then
MsgBox "OUTLOOK NON APERTO!", vbExclamation
Exit Sub
End If
blnStart = True
End If
On Error GoTo ErrHandler
Set olNsp = olApp.GetNamespace("MAPI")
'Set olFld = olNsp.GetDefaultFolder(6).Folders("SERVIZIO")
Set olFld = olNsp.GetDefaultFolder(6) ' 3 = Inbox
Naturally is a Hans code:-)