views:

93

answers:

4

Hi all,

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?

+1  A: 

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

BeachBlocker
A: 

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

nitroxn
I'm doing this: NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);NSString* path;NSString* gradeDoc = [self fetchCommentsDesc];NSString* str = [self.objStudent.strName stringByAppendingFormat:@".doc"];path = [[paths objectAtIndex:0] stringByAppendingPathComponent:str];[gradeDoc writeToFile:path atomically:YES encoding:NSUTF8StringEncoding error:nil];Can anybody please provide me the code to write a .doc file
Saurabh Verma
[self fetchCommentsDesc] returns NSString.self.student.strName is a String
Saurabh Verma
if its hard to write a .doc file, does anybody knows how to write a .rtf file instead. i tried writing .rtf but facing same problems
Saurabh Verma
A: 

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.

boreas
A: 

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.

amok
Thanks a lot, this will help me
Saurabh Verma
good then mark it as an answer if that is the case.
amok
Hello, I'm trying to accomplish the same task. Is there any way you could elaborate on how to accomplish this. I'm not sure what VSTO is or what you need to use it. Thanks.
NickDK