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.

funny characture after textbox entry

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fred Kruger - 16 Dec 2004 11:02 GMT
I have a user form which has a textbox in which is set to mulit line and
enter enabled, the contents of this textbox is then transfered to a texbox
form field with a document.

If the user enters more than one line of text in the userform textbox when
it is added to the document at the begining of each line is a small square,
how do i get rid of this.

Thanks in anticipation
Jean-Guy Marcil - 16 Dec 2004 15:11 GMT
Fred Kruger was telling us:
Fred Kruger nous racontait que :

> I have a user form which has a textbox in which is set to mulit line
> and enter enabled, the contents of this textbox is then transfered to
[quoted text clipped - 3 lines]
> when it is added to the document at the begining of each line is a
> small square, how do i get rid of this.

When you hit Enter in a userform textbox, Word inserts both a linefeed
character [Chr(10)] and a carriage return [Chr(13)].
The square you see are the line feed characters.
If you are using Word 2000 and above, try this (Otherwise, the Replace
function is not available, then a function has to be used, let us know if
you need one).

'_______________________________________
Dim MyString As String

MyString = Me.TextBox1.Text

MyString = Replace(MyString, Chr(10), "")

ActiveDocument.FormFields("Text2").Result = MyString
'_______________________________________

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.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.