BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-17-2011, 01:45 PM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2011
Model: 8900
PIN: N/A
Carrier: Torch
Posts: 59
Post Thanks: 3
Thanked 1 Time in 1 Post
Default open .docx file

Please Login to Remove!

Hello,

I am creating .doc file & .docx file in blackberry. I am using eclipse.

FileConnection fileConn=null;
OutputStream os=null;
String data="Blackberry Bold";

String fileName="file:///SDCard/DocumentFile.doc";

fileConn= (FileConnection)Connector.open(fileName,Connector. READ_WRITE);

if (fileConn.exists())
{
file.delete();
}
fileConn.create();
os=fileConn.openDataOutputStream();
os.write(data.getBytes());

Above code creates .doc file in SDCard. When i open it opens document & show contents but if i create .docx file it creates file w/o giving any error , write data in it. when i open SDCard it shows me .docx file but when i open it shows
MediaControl/filename.docx
Unable to display file

I am creating .docx file n following way:-


FileConnection fileConn=null;
OutputStream os=null;
String data="Blackberry Bold";

String fileName="file:///SDCard/abc.docx";

fileConn= (FileConnection)Connector.open(fileName,Connector. READ_WRITE);

if (fileConn.exists())
{
file.delete();
}
fileConn.create();
os=fileConn.openDataOutputStream();
os.write(data.getBytes());


It creates file but it doesnt open.
Can any body tells why it doesnt open .docx file however it opens .doc file.
There is not very much difference b/w .doc & .docx
If it opens .doc it must open .docx
Offline  
Old 03-17-2011, 02:20 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default Re: open .docx file

I don't agree with your statement "if it opens .doc it must open .docx"

Obviously there is no handler for .docx on your device.
Offline  
Old 03-18-2011, 12:25 PM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2011
Model: 8900
PIN: N/A
Carrier: Torch
Posts: 59
Post Thanks: 3
Thanked 1 Time in 1 Post
Default Re: open .docx file

.doc & .docx both opens are basically document files.

If there is not handler for .docx then how it handles .doc file. It must not open .doc file also. If it handles .doc file it must also handle .docx file & as you said abt handler then how it wll handle .docx ?
Offline  
Old 03-18-2011, 12:56 PM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2011
Model: 8900
PIN: N/A
Carrier: Torch
Posts: 59
Post Thanks: 3
Thanked 1 Time in 1 Post
Default Re: open .docx file

Can you please explain why .docx isnt opening. what you mean by handler??
even i create pdf it also doesnt open
Offline  
Old 03-18-2011, 02:28 PM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default Re: open .docx file

.doc and .docx are completely different formats, right? .docx is an ZML dlocument format, .doc is a legacy MS Word binary format. They are not the same.
Offline  
Old 03-18-2011, 08:28 PM   #6 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default Re: open .docx file

Edit: That should read "XML", not "ZML".
Offline  
Old 03-19-2011, 06:12 AM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2011
Model: 8900
PIN: N/A
Carrier: Torch
Posts: 59
Post Thanks: 3
Thanked 1 Time in 1 Post
Default Re: open .docx file

Hello Dougsg38p ,

Then what should i do so it opens .docx file & doesnt display message Unable to open .docx file
i am implementing this code in eclipse & testing both in simulator & device. Even i test on 9700 simulator but .docx isnt opening
Can you please tell should i install something or what other should i do so it opens .docx

Why it is not opening pdf file. I am reading from pdf file & creating pdf in this way:-

String fileName="file:///SDCard/PDFFile.pdf";

It create file but its size is 1 KB & actual file size is 314 kB. I am reading pdf in the same way as i was reading .doc & .docx.
It doesnt open .docx on device but i can open it on system but when i create pdf its size is just 1 kb & when i open from system it display message that file is corrupt. It shold open atleast from system.
Can you please suggest some possible solution Dougsg38p

Thanks
Offline  
Old 03-23-2011, 04:55 AM   #8 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2011
Model: 8900
PIN: N/A
Carrier: Torch
Posts: 59
Post Thanks: 3
Thanked 1 Time in 1 Post
Default Re: open .docx file

Can you please tell which files are supported in blackberry like pdf,.docx...

Currently i m testing on device & in Java Plugin eclipse 4.5 for blackberry. In simulator it create .docx but shows "Unable to display .docx file". It create pdf but doesnt open pdf also.
I test in device also but it doesnt open .docx also.

So, can you tell is this due to os version of blackberry.
I tested in 9700 simulator but it also doesnt open .docx
Can any one tell what should i do ...should i install some thing or what other ?? so i can open .docx & pdf in simulator as well as in device.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: open .docx file
Thread Thread Starter Forum Replies Last Post
Losing Call Logs, SMS or Emails? Optimize your BB! How To Setup for max free memory! John Clark BlackBerry Help 1620 12-31-2012 07:43 AM
Setup up Eclipse for BlackBerry development plevintampabay Developer Forum 40 01-11-2012 01:15 AM
Open file in file explore programmatically. Maxim Kornilov Developer Forum 0 11-16-2008 06:06 AM
sending a file thru bluetooth direct from open word document maish Bluetooth Connection 0 09-06-2007 05:20 PM
Saved IPD file in Excel and not able to open in Excel golfleft BlackBerry Guides 1 05-05-2006 07:32 AM





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.