|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Jun 2001
Città: Catania
Messaggi: 2696
|
[VB2010] - Percorso file/s .pst di Outlook 2010
Salve ragazzi,
tramite VB2010 ho la necessità di popolare una ListBox con il percorso del o dei file/s .pst relativi Outlook 2010. In breve mi servirebbe capire come recuperare il percorso indicato nell'immagine a seguire che in questo caso è solo uno ma potrebbe anche essere maggiore: ![]() Grazie
__________________
Unisciti a noi: http://www.swproduction.altervista.org/ - http://www.enews.altervista.org/
|
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Jun 2001
Città: Catania
Messaggi: 2696
|
...girando un pò su internet ho trovato anche questa soluzione:
Codice:
Private Sub Main()
Dim o As Outlook.Application
Dim n As NameSpace
Dim f As MAPIFolder
Dim s As String
Dim x As Long
o = CreateObject("outlook.application")
n = o.GetNamespace("MAPI")
n.Logon()
For Each f In n.Folders
Debug.Print(f.Name)
s = f.StoreID
Debug.Print(s)
For x = 1 To Len(s) - 1 Step 2
Debug.Print Chr$("&H" & Mid$(s, x, 2));
Next
Debug.Print()
Next
n.Logoff()
n = Nothing
o = Nothing
End Sub
Codice:
Dim o As Outlook.Application
Dim n As NameSpace
Dim f As MAPIFolder
Ho trovato anche quest'altra soluzione: Codice:
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOLApp.GetNamespace("MAPI")
For Each objfolder In myNamespace.Folders
WScript.Echo("Name: " & objfolder.Name)
Next
Codice:
Public Function GetPathFromStoreID(sStoreID As String) As String
On Error Resume Next
Dim i As Long
Dim lPos As Long
Dim sRes As String
For i = 1 To Len(sStoreID) Step 2
sRes = sRes & Chr("&h" & Mid$(sStoreID, i, 2))
Next
sRes = Replace(sRes, Chr(0), vbNullString)
lPos = InStr(sRes, ":\")
If lPos Then
GetPathFromStoreID = right$(sRes, (Len(sRes)) - (lPos - 2))
End If
End Function
Codice:
myOlApp = CreateObject("Outlook.Application")
myNamespace = myOLApp.GetNamespace("MAPI")
__________________
Unisciti a noi: http://www.swproduction.altervista.org/ - http://www.enews.altervista.org/
Ultima modifica di lucausa75 : 29-06-2011 alle 10:23. |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 07:14.




















