How to open a file and then save it?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a program that I want to open a file and then save it as a different type (i.e. open a .txt file and save it as a RTF). How can I do this programatically?
 
Hi Tim,

You will first have to open an instance of the Word object; then you would
open and save using the methods that that obj provides.

HTH,

Bernie Yaeger

Tim Smith said:
I have a program that I want to open a file and then save it as a
different type (i.e. open a .txt file and save it as a RTF). How can I do
this programatically?
 
I have a program that I want to open a file and then save it as a different type (i.e. open a .txt file and save it as a RTF). How can I do this programatically?

Open the text file and read the entire contents into a string. Create a
RichTextBox control, set the text of it to the string and then use the
RichTextBox.SaveFile() method to dump it out in RTF format.
 
Back
Top