Delete Attachment from Outlook 2002 Form: "Operation Failed" 
Author Message
 Delete Attachment from Outlook 2002 Form: "Operation Failed"

I have an Outlook 2002 custom task form which has a listbox
(lstAttachment) which displays the displaynames of all files currently
attached. The following function is intended to delete the item in the
list box which is currently selected. I receive an "Operation Failed"
error when executing the "curitem.delete" statement. In break mode,
the current item appears to be set correctly.

Any suggestions are appreciated.

Tyson

===============

Function cmdDelete_Click

        Set myControl = Item.GetInspector.ModifiedFormPages("Request for
Pricing Services").controls("lstAttachment")
        if mycontrol.listindex <> -1 then
                fileName = mycontrol.value
                for i = 1 to item.attachments.count
                        set curitem = item.attachments(i)
                        if curItem.displayname = filename then
                                curitem.delete
                                ListAttachments
                                Exit Function
                        end if
                next
        end if

End Function



Tue, 12 Oct 2004 23:08:47 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. msg "the operation failed"

2. item.cc "The operation failed" - Help

3. GetObject("","InternetExplorer.Application") fails in Excel VBA

4. GetObject("","InternetExplorer.Application") fails in Excel VBA

5. Suppress "Printing" dialog in Word 2002

6. "Unrecognized database format ..." - Access 2002

7. "Pocket PC 2002"-mode: eVB program can′t run

8. Displaying "Outlook Address List" Dialog Form

9. Send form using Outlook, "For Astrid"

10. How to use "unload form", "form.hide", "form.visible =false "?

11. How to use "unload form", "form.hide", "form.visible =false "?

12. How to use "unload form", "form.hide", "form.visible =false "?

 

 
Powered by phpBB® Forum Software