Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

Carriage return characture

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fred Kruger - 15 Dec 2004 18:21 GMT
I have a textbox in a userform which is called txtDetail it is set for
muliline entry and also enter key enabled.

When the contents entered in this textbox is transfered to the document a
small square is placed in from of each new line.

I know it is the carriage return symbol how do i get rid please.

cheers fred
Helmut Weber - 16 Dec 2004 16:39 GMT
Hi Fred,
I can't reproduce this, but anyway,
how about putting the contents of the textbox
in a string and then using replace.
As far as I see, there are only three ways
of creating a line feed in a textbox:
ctrl-return, shift-return and ctrl-shift-return,
which result in vbcrlf and vblf.
Ok, like this:

Private Sub CommandButton1_Click()
Dim s As String
s = TextBox1.Text
' s = Replace(s, vbCr, " ") ?
s = Replace(s, vbCrLf, " ")
s = Replace(s, vbLf, " ")
Selection.TypeText Text:=s
End Sub

If that doesn't help, one could built a loop
and replace any character below 32 by " ".

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.