简体   繁体   中英

How to write a MsWord (.doc) file in Objective C?

I need to write pure Msword file in objective C. I have been writing .txt file till now but when i write a .doc file i'm facing encoding issues with all encoding schemes. Microsoft provide library in visual studio to play with .doc files which is not available in Xcode. So is there any way to make it happen?

You can extract the code from eg OpenOffice project. This is C++ code, but you can use a wrapper around. This will be a lot of work.

Sounds like you are trying to port MS word. Basically u need to write XML files and zip them in a particular manner. Check out the markup specification here http://msdn.microsoft.com/en-us/library/cc313105%28office.12%29.aspx

if it's .docx, you may compose an XML file and rename it. With .doc you may have to do it with your own wrapper.

If it's an option for you: On the server use Microsft VSTO to create a document (doc,els,ppt...) using ServerDocument class and passing the data that you collect on the client. Then you download that file and your phone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM