title image


Smiley I got it !!
Hi Carmen.



Ich habe hier eine wie ich meine sehr elegante Lögung gefunden ... Public Function MoveItems(TargetFolder As String, SourceFolder As String)



'On Error Resume Next



Dim objMyMailbox As MAPIFolder

Dim objSourceFolder As MAPIFolder

Dim objTargetFolder As MAPIFolder

Dim oItems() As Object

Dim objItem As Object



Dim iItemsCount As Integer

Dim iProcess As Integer

Dim i As Integer



Set objOL = New Outlook.Application

Set objNS = objOL.GetNamespace("MAPI")

Set objMyMailbox = objNS.Folders(GetUserFullName)

Set objSourceFolder = objMyMailbox.Folders(SourceFolder)

Set objTargetFolder = objMyMailbox.Folders(TargetFolder)



iItemsCount = objSourceFolder.Items.Count

frmMain.pgProcess.Max = iItemsCount

frmMain.pgProcess.Min = 0



For i = iItemsCount To 1 Step -1

objSourceFolder.Items(i).Move objTargetFolder

frmMain.lblInfo.Caption = "Move " & i & " of " & iItemsCount & " Items from " & SourceFolder & " to " & TargetFolder

frmMain.lblInfo.Refresh

frmMain.pgProcess.Value = iProcess

iProcess = iProcess + 1

Next i



frmMain.pgProcess.Value = iItemsCount

frmMain.lblInfo.Caption = "Moving Items from " & SourceFolder & " to " & TargetFolder & " complete."



Exit Function



End FunctionGruss pmo


Besten Dank und Gruss aus der Schweiz pmo

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: