English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I read a text file as input and want to modify the data readin by increasing font size,underline the header and write out into a word document file using visual basic.

2006-06-15 00:45:27 · 3 answers · asked by grace044 g 1 in Computers & Internet Programming & Design

3 answers

There are several ways that you can do it. If you are using a version post Office 2K3, all office products are based on a schema which is available at: http://www.microsoft.com/office/xml/default.mspx. You can create an XML document conforming to the schema and save it to a .doc file and word will interpert it as a word document. The XML approach is fairly flexible and gives you access to all formatting etc. Another approach is to encode whatever you want to present as RTF. YOu can get more information on this at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec_2.asp. Another option is to use the Office objects inside of VB to code a document. And finally there's always good ole (note sarcasm) OLE where you basically shell out to Office and control it programmatically. I encourage against this.

2006-06-15 02:42:56 · answer #1 · answered by brownfreckles1977 2 · 0 0

I think that this is what you are looking for.

Run a few tests to get used to it. Save some formatted text in Wordpad as type RTF then open the file with notepad to see the encoding.

2006-06-15 08:19:52 · answer #2 · answered by AnalProgrammer 7 · 0 0

the easiest way to do it is read each line of your source .txt file and write that to your runtime created .doc file

2006-06-15 07:48:45 · answer #3 · answered by kunal_oncyber 2 · 0 0

fedest.com, questions and answers