ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getting paragraphs of text into a textbox control (https://www.excelbanter.com/excel-programming/337699-getting-paragraphs-text-into-textbox-control.html)

Gordon[_2_]

Getting paragraphs of text into a textbox control
 
I have a textbox control on a user form that needs to contain several
paragraphs of text. I have these paragraphs in a rich text file edited and
saved in Word. I would rather not do this in VBA code, because the text
never changes and really should be permanently stored with the textbox. Two
years ago I somehow was able to get all these paragraphs of text into the
textbox control, and I did so without using VBA code and without typing the
text into the text slot of the textbox's property window in VBA, which anyway
will not take carriage returns. It does not work to copy the text from the
rich text file to the clipboard and paste into the text slot in the property
window - only text up to the first carriage return is pasted.

Any suggestions?

Rowan[_2_]

Getting paragraphs of text into a textbox control
 
Gordon

You could swap the Textbox for a RichTextBox which will allow you to paste
the text from word (via the clipboard) with the carriage returns in place.

You can get the RichTextBox by rightclicking the Toolbox and selecting
Additional Controls. Check Microsoft Rich TextBox Control (version 6.0 in
Excel 2002).

Hope this helps
Rowan

"Gordon" wrote:

I have a textbox control on a user form that needs to contain several
paragraphs of text. I have these paragraphs in a rich text file edited and
saved in Word. I would rather not do this in VBA code, because the text
never changes and really should be permanently stored with the textbox. Two
years ago I somehow was able to get all these paragraphs of text into the
textbox control, and I did so without using VBA code and without typing the
text into the text slot of the textbox's property window in VBA, which anyway
will not take carriage returns. It does not work to copy the text from the
rich text file to the clipboard and paste into the text slot in the property
window - only text up to the first carriage return is pasted.

Any suggestions?


Gordon[_2_]

Getting paragraphs of text into a textbox control
 
Thanks for the suggestion, but I have deliberately moved away from
RichTextBoxes because they make my application nonportable - users who don't
have them on their machine can't read my text boxes.

This is frustrating because I am sitting here looking at regular textbox
controls containing paragraphs of text - somehow I did this two years ago!

Gordon

"Rowan" wrote:

Gordon

You could swap the Textbox for a RichTextBox which will allow you to paste
the text from word (via the clipboard) with the carriage returns in place.

You can get the RichTextBox by rightclicking the Toolbox and selecting
Additional Controls. Check Microsoft Rich TextBox Control (version 6.0 in
Excel 2002).

Hope this helps
Rowan

"Gordon" wrote:

I have a textbox control on a user form that needs to contain several
paragraphs of text. I have these paragraphs in a rich text file edited and
saved in Word. I would rather not do this in VBA code, because the text
never changes and really should be permanently stored with the textbox. Two
years ago I somehow was able to get all these paragraphs of text into the
textbox control, and I did so without using VBA code and without typing the
text into the text slot of the textbox's property window in VBA, which anyway
will not take carriage returns. It does not work to copy the text from the
rich text file to the clipboard and paste into the text slot in the property
window - only text up to the first carriage return is pasted.

Any suggestions?


Rowan[_2_]

Getting paragraphs of text into a textbox control
 
With the normal textbox in properties set mulitline = true. Again should let
you paste text with carriage returns.

Regards
Rowan

"Gordon" wrote:

Thanks for the suggestion, but I have deliberately moved away from
RichTextBoxes because they make my application nonportable - users who don't
have them on their machine can't read my text boxes.

This is frustrating because I am sitting here looking at regular textbox
controls containing paragraphs of text - somehow I did this two years ago!

Gordon

"Rowan" wrote:

Gordon

You could swap the Textbox for a RichTextBox which will allow you to paste
the text from word (via the clipboard) with the carriage returns in place.

You can get the RichTextBox by rightclicking the Toolbox and selecting
Additional Controls. Check Microsoft Rich TextBox Control (version 6.0 in
Excel 2002).

Hope this helps
Rowan

"Gordon" wrote:

I have a textbox control on a user form that needs to contain several
paragraphs of text. I have these paragraphs in a rich text file edited and
saved in Word. I would rather not do this in VBA code, because the text
never changes and really should be permanently stored with the textbox. Two
years ago I somehow was able to get all these paragraphs of text into the
textbox control, and I did so without using VBA code and without typing the
text into the text slot of the textbox's property window in VBA, which anyway
will not take carriage returns. It does not work to copy the text from the
rich text file to the clipboard and paste into the text slot in the property
window - only text up to the first carriage return is pasted.

Any suggestions?


Gordon[_2_]

Getting paragraphs of text into a textbox control
 
Thanks again, but multiline was already set to true. Pasting only pastes up
to (but not including) the first carriage return.

Gordon

"Rowan" wrote:

With the normal textbox in properties set mulitline = true. Again should let
you paste text with carriage returns.

Regards
Rowan

"Gordon" wrote:

Thanks for the suggestion, but I have deliberately moved away from
RichTextBoxes because they make my application nonportable - users who don't
have them on their machine can't read my text boxes.

This is frustrating because I am sitting here looking at regular textbox
controls containing paragraphs of text - somehow I did this two years ago!

Gordon

"Rowan" wrote:

Gordon

You could swap the Textbox for a RichTextBox which will allow you to paste
the text from word (via the clipboard) with the carriage returns in place.

You can get the RichTextBox by rightclicking the Toolbox and selecting
Additional Controls. Check Microsoft Rich TextBox Control (version 6.0 in
Excel 2002).

Hope this helps
Rowan

"Gordon" wrote:

I have a textbox control on a user form that needs to contain several
paragraphs of text. I have these paragraphs in a rich text file edited and
saved in Word. I would rather not do this in VBA code, because the text
never changes and really should be permanently stored with the textbox. Two
years ago I somehow was able to get all these paragraphs of text into the
textbox control, and I did so without using VBA code and without typing the
text into the text slot of the textbox's property window in VBA, which anyway
will not take carriage returns. It does not work to copy the text from the
rich text file to the clipboard and paste into the text slot in the property
window - only text up to the first carriage return is pasted.

Any suggestions?


Gordon[_2_]

Getting paragraphs of text into a textbox control
 
My apologies - I had locked the textbox. When I unlock it, it accepts
pasting with paragraphs right into the userform without needing the
properties window. I tried unlocking it before, but apparently I either
unlocked something else by mistake or failed to save the unlock - who knows?
Thanks for your help anyway.

Gordon

"Gordon" wrote:

Thanks again, but multiline was already set to true. Pasting only pastes up
to (but not including) the first carriage return.

Gordon

"Rowan" wrote:

With the normal textbox in properties set mulitline = true. Again should let
you paste text with carriage returns.

Regards
Rowan

"Gordon" wrote:

Thanks for the suggestion, but I have deliberately moved away from
RichTextBoxes because they make my application nonportable - users who don't
have them on their machine can't read my text boxes.

This is frustrating because I am sitting here looking at regular textbox
controls containing paragraphs of text - somehow I did this two years ago!

Gordon

"Rowan" wrote:

Gordon

You could swap the Textbox for a RichTextBox which will allow you to paste
the text from word (via the clipboard) with the carriage returns in place.

You can get the RichTextBox by rightclicking the Toolbox and selecting
Additional Controls. Check Microsoft Rich TextBox Control (version 6.0 in
Excel 2002).

Hope this helps
Rowan

"Gordon" wrote:

I have a textbox control on a user form that needs to contain several
paragraphs of text. I have these paragraphs in a rich text file edited and
saved in Word. I would rather not do this in VBA code, because the text
never changes and really should be permanently stored with the textbox. Two
years ago I somehow was able to get all these paragraphs of text into the
textbox control, and I did so without using VBA code and without typing the
text into the text slot of the textbox's property window in VBA, which anyway
will not take carriage returns. It does not work to copy the text from the
rich text file to the clipboard and paste into the text slot in the property
window - only text up to the first carriage return is pasted.

Any suggestions?



All times are GMT +1. The time now is 01:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com