BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   Working with Word attachments - how to get text (http://www.blackberryforums.com/developer-forum/14869-working-word-attachments-how-get-text.html)

pchap 09-05-2005 05:59 AM

Working with Word attachments - how to get text
 
Hi,

I'm attempting to retrieve the text using the mail API from a Word attachment (I'm using BES + the attachment service in case that's important).

I can get hold of the attachment & it reports the correct filename and is of type UnsupportedAttachmentPart

Calling getContent() on this returns an object of type DocViewAttachmentPartModel ... for which I can find no information at all...

Does anybody have any idea how to get hold of the text of a Word attachment ?

thanks for any help
Pete

Code:


Multipart cont = (Multipart)m.getContent();

System.out.println("# attachments: " + cont.getCount());

if(attachmentNumber < cont.getCount()) {
                       
        UnsupportedAttachmentPart bp = (UnsupportedAttachmentPart)cont.getBodyPart(attachmentNumber);
                                                               
        System.out.println("filename: " + bp.getName());                               
        System.out.println("size: " + bp.getSize());
                       
        if(bp.getName().equals(filename)) {                               
                attachText = bp.getContent();
                               
                System.out.println(attachText.getClass().getName());
        }
}



All times are GMT -5. The time now is 01:11 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.