2017-05-11 9 views

答えて

0
#Send all items in the "Drafts" folder that have a "To" address filled in. 

#Setup Outlook 
Add-Type -assembly "Microsoft.Office.Interop.Outlook" 
$Outlook = New-Object -comobject Outlook.Application 
$myOutlook = $Outlook.Application 
$myNameSpace = $myOutlook.GetNamespace("MAPI") 
$myFolders = $myNameSpace.Folders 

#Set Draft Folder. 
$myDraftsFolder = $myFolders("[email protected]").Folders("Drafts") 

#Loop through all Draft Items 

$myDraftsFolder.Items|foreach-object { 

    #Check for "To" address and only send if "To" is filled in. 
    If ($_.To.trim().length -gt 0) { 

    #Send Item 
    $_.Send 

    } 
} 

この

を試してみてください
関連する問題