Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1313
  • Last Modified:

Wordpad and OLE

Is Wordpad OLE enabled?
From a VB app, I would like to execute Wordpad, have it reformat my text and then exit. I intend to do this repeatedly.
The purpose is to take raw text, which is the result of an OCR proces and format as RTF (rich text format).
Thanks to anyone that may know.
  • 2
  • 2
1 Solution
Yes WordPad is OLE enabled, but I don't know what you mean by the rest of the question. Can you rephrase it?
rhprhpAuthor Commented:
Edited text of question
if you're just trying to SAVE some TEXT as .RTF, I'd use the SAVEFILE command
Savefile cam save the contents of a RichTextBox control to a file.. If you need more help than this, post a comment.
The following is pasted directly from the VB5 Help File


object.SaveFile(pathname, filetype)

The SaveFile method syntax has these parts:

Part      Description
object      Required. An object expression that evaluates to an object in the Applies To list.
pathname      Required. A string expression defining the path and filename of the file to receive the contents of the control.
filetype      Optional. An integer or constant that specifies the type of file loaded, as described in Settings.

The settings for filetype are:

Constant      Value      Description
rtfRTF      0      (Default) RTF. The RichTextBox control saves its contents as an .RTF file.
rtfText      1      Text. The RichTextBox control saves its contents as a text file.

You can also use the Write function in Visual Basic and the TextRTF and SelRTF properties of the RichTextBox control to write .RTF files. For example, you can save the highlighted contents of a RichTextBox
 control to an .RTF file as follows:

Open "mytext.rtf" For Output As 1

Print #1, RichTextBox1.SelRTF
Do you have any comments as to why you are rejecting jlove1 answer.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now