Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

Posts: 15
Registered: ‎08-14-2008
My Device: 8300 with b75 OS

How to create new inbox mail with attachment

[ Edited ]

Hi, I want to create inbox message with attachment .doc. I came to this code (using hints from this forum):


  Message msg = new Message();

 try {          
            msg.addRecipient(Message.RecipientType.TO, new Address("blazej@test.biz", "BlazejUsingBB" ));
        } catch(MessagingException e) {


msg.setSubject("This is subject" ) ;

 Multipart multipart = new Multipart();
        SupportedAttachmentPart attach = new SupportedAttachmentPart( multipart, "application/msword",  "document.doc", "sample data - other in use" );


          msg.setSentDate(new Date());
          msg.setStatus(Message.Status.RX_RECEIVED, 1);
          msg.setFlag(Message.Flag.REPLY_ALLOWED, true) ;
        catch(MessagingException e)
          System.out.println(e.toString()) ;


This would create nearly perfect inbox message, with correct icon, updated the counter of new messages, attachment is in the message, also with 'open attachment' choice in the menu.


The problem is:  I have Doc2Go installed on my BB (8300, running b75). After choosing to open this attachment, Doc2Go is running, but the attachment is not opened, the Doc2Go just displaybrowser with files on computer.


Somebody can help me with this? I'm really stucked here and also tired of trying without success. Smiley Sad


Thanks for any hints.

Message Edited by Blazej on 09-03-2008 11:03 AM
Message Edited by Blazej on 09-03-2008 04:19 PM
Message Edited by Blazej on 09-03-2008 04:21 PM