Write Formatted text in a doc file

S

sonu

I am getting some data 'strData' from database through reader object.
The data 'strData' is sent to a doc using FilesystemObject line by line
in doc file located on a specific location.

1.Code for writting line to doc is:

//////////////////
Dim objReader As StreamWriter
objReader = New StreamWriter(FullPath)
objReader.Write(strData)
objReader.Close()
//////////////////////////
I want to write the formatted text in doc file like change the colour
of text and size

Any help will be Appreciated

Regards
Amit(Sonu)
 
J

Jani Järvinen [MVP]

Hello,
I want to write the formatted text in doc file like change the colour
of text and size

Did I understand you correctly that you are reading (plain text?) data from
a database, and would like to write that data with some formatting to a
file?

If so, then in what format the database data is? Is it already formatted?
And, what kind of formatting would you like to use in the file? Without more
information I'm afraid we cannot help you much.

Thanks!

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/
 
S

sonu

Hi Jani,
Thanks for reply.

suppose i got some data from database in a datareader and if i write
this data in doc file that data will be stored in that file in simple
way.

and when u see that file,the data will be displayed in a line in that
doc file.

I want to display the data in doc file in formatted way.. like the Text
color in that doc file scould be red size should be 5 and that data
should be displayed in table.

Regards
Amit
 
J

Jani Järvinen [MVP]

Hello Amit,
I want to display the data in doc file in formatted way.. like the Text
color in that doc file scould be red size should be 5 and that data
should be displayed in table.

If you want to format the document file, you could use simple HTML or for
instance RTF. Depending on your application, you could either create this
data in HTML or RTF format yourself (not that difficult), or you could use
Word through OLE Automation (COM) which gives you all the formatting
features that Word has. But this usually isn't a good option if your
application is a web application (ASP.NET) for example.

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top