• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps App create microsoft word documents?

M

Member1097418

Guest
My current app I'm developing needs to create word documents (.doc) to display full on reports for my users. Is this possible?

The idea is after the user fills in a few text views, the app gathers that data and inputs it in a new word doc, kind of like a generator to generate essays/legal documents.

Thanks
 
You will need to find the structure of the .doc format. If I remember correctly, the ,doc format is a binary format, so it's not as simple as just opening it in a text editor. You should be able to find the structure on the web somewhere though. You could also use the newer .docx format which is just an XML file, so it can be read using any text editor, so you can easily figure out the structure yourself if you really wish.

Lastly, there are likely preexisting java libraries out there that will do this for you, so I would look for one of those before diving into file structures.
 
Upvote 0
You will need to find the structure of the .doc format. If I remember correctly, the ,doc format is a binary format, so it's not as simple as just opening it in a text editor. You should be able to find the structure on the web somewhere though. You could also use the newer .docx format which is just an XML file, so it can be read using any text editor, so you can easily figure out the structure yourself if you really wish.

Lastly, there are likely preexisting java libraries out there that will do this for you, so I would look for one of those before diving into file structures.

HA! Got it! All it took was a simple "Save-As" and Word XML was one of the options.

Thanks, now I just have to go through the mess that Microsoft has on these files.
 
Upvote 0
Just thought I'd shoot an update on this. I couldn't figure out a way to create .doc in java. I tried writing to a new .doc file with java, I also tried using the built in XMLParser and also tried with strings and it just wasn't working.

The solution I'm going for? ASP .NET to create the file and Android web view to connect to webpage. The only problem I'm facing is being able to get the web view to accept the .doc download. Anyone experience with accepting downloads on web views?

If not I'll just have ASP .NET create the file and e-mail it. Instead of creating too much overhead for my app, ASP .NET servers will pick up the heavy lifting.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones