Question

Locked

Printing Rich Text Box data in word through VB

By vsasikala ·
hi,

I have a code to change the font style of Rich text box during runtime. Now i want to print the same data in MSWord. (I don't want to store the data) When i am trying to print the data i am getting only datas without its different kind of styles.

Could anybody help me to write the code.

Sasi

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

You need to learn the RTF language

by pathak.abhishek In reply to Printing Rich Text Box ...

See, rtf documents are very similar to html documents in principal(they both work using 'tags').If you need to print data to rtf documents then you should learn these tags,i.e. the RTF language. In my opinion the best place for code and theory for VB is Mastering VB 6 , written by Evangelos Pertroutso. Otherwise, if you are not mad about using rtf ONLY, then I suggest that you go for OLE of OLE Automation(better,easier) and use a .doc format to show data by 'Automating MS word'. The method is simple:
1.Add a reference to MS word using reference from menu in VB.
2.Create a withevents object of words.doucments type.
3.Then using the methods and data exposed by this object(it will show up automatically by autocomplete), you can not only show data, but do things far-far-far greater than that.
4.Hope you know that you will also have to create an OLE object by either 'linking' or 'embedding' if you use OLE(not OLE Automation).
5.I suggest an even better method, that is to look for some ActiveX plugins which could handle your task automatically.
In case of further doubts , I think that Mastering VB 6 book should be able to solve your problem.

Back to Peripheral Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums