Advertisement
imjyb1008work

RemoveAllAttachment

Jun 10th, 2014
717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function RemoveAttachment( doc As NotesDocument )
  2.     On Error Goto ErrorFlag
  3.    
  4.     '移除附件
  5.     Dim object As Variant
  6.     Dim names As String
  7.    
  8.     Forall item In doc.Items
  9.    
  10.         If(Ucase(item.name) = Ucase("$file")) Then
  11.        
  12.             names = item.values(0)
  13.            
  14.             If names<>"" Then
  15.                 Msgbox "移除附"+names+"開始"
  16.                 Set object = doc.Getattachment(names)
  17.                 Call object.remove()
  18.                 Msgbox "移除附件"+names+"結束"
  19.             End If
  20.            
  21.             Msgbox names
  22.            
  23.         End If
  24.        
  25.     End Forall
  26.    
  27.     Exit Function
  28. ErrorFlag:
  29.     MsgBox "RemoveAttachment:" & erl()
  30. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement