Word 2003 read rtf file into textbox

J

jans__

Hi,

Is there a way to read a .rtf file into a textbox
I only would like te read the text without the format, without
actually opening the file.

thanx

Jans
 
D

David Sisson

Hi,

Is there a way to read a .rtf file into a textbox
I only would like te read the text without the format, without
actually opening the file.
I'm not sure about 'without opening the file'. Kinda like eating a
can of pineapple without opening the can. :)

But I digress. How about this?

Sub InsertIntoTextbox()
'David Sisson 2007

Dim rRange As Range

Set rRange = ActiveDocument.Shapes(1).TextFrame.TextRange

rRange.InsertFile FileName:="sample RTF.rtf", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False

rRange.Select
Selection.ClearFormatting

End Sub
 
J

jans__

On Nov 26, 7:44 am, (e-mail address removed) wrote:> Hi,


I'm not sure about 'without opening the file'. Kinda like eating a
can of pineapple without opening the can. :)

But I digress. How about this?

Sub InsertIntoTextbox()
'David Sisson 2007

Dim rRange As Range

Set rRange = ActiveDocument.Shapes(1).TextFrame.TextRange

rRange.InsertFile FileName:="sample RTF.rtf", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False

rRange.Select
Selection.ClearFormatting

End Sub

I'm sorry, I wasn't very clear,
i would like to read the content of a rtf file into a textbox control
on my userform.
 
D

David Sisson

I'm sorry, I wasn't very clear,
i would like to read the content of a rtf file into a textbox control
on my userform.

I couldn't find a way. Not without opening the file first

Sorry.
 

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