Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!
I want to design application in C which contains text file as input.In that we have to read line from input file as first line contains keyword 'NET' and next line containing keyword 'LOC'.Read these two lines at same time and write to word document in table format as first line in one column and second line in second column of table.Also sort table entries according to third input given by user.
In my application i tried to read line from text file from text file and write to word as it is,but not in table format.How to write entries in table format of word??
Posted
Comments
Richard MacCutchan 19-Aug-14 4:45am    
You would need to create the content in Word format, which is certainly not easy in pure C code. Even using the Word.Interop in C# is something of a challenge.

As Richard wrote C# is a possible way - not only, but it is the "natutarl interface" which microsoft designs for such purposes. (So there is no other)

An alternative solution in C is to write in RTF Format which word can read.
 
Share this answer
 
Word can understand many data formats. Rich text format was mentioned. Write your data file as html file and create your own table markup containing your data. Word will read this without any trouble and display it.

If you want to get really fancy crazy you can write an XSL processor in which the rules emit the HTML but that is a very advanced topic.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900