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 / October 2006

Tip: Looking for answers? Try searching our database.

Unusual Return Symbol

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CasNotts - 29 Oct 2006 15:30 GMT
When a user populates a field on a userform and enters a return character,
the output displays a square box, is there any way to suppress this character
from appearing in the output, yet still display the text on 2 lines?

Basically I am not sure what to search for in the captured text before I
output it to the Word document.  I could easily incoporate vbCR if I knew
what to look for and replace.

Thanks in anticipation of your help.
Art H - 31 Oct 2006 19:28 GMT
I don't quite understand the issue. Here's what I did.

I created a userform with one textbox and one command button. The
command button allows me to exit the textbox. I changed the following
for the textbox from their defaults:
 EnterKeyBehavior and MultiLine from False to True

I created one event for the command button:
 Private Sub CommandButton1_Click()
 MsgBox Me.TextBox1.Text
 For i = 1 To Len(Me.TextBox1.Text)
   Debug.Print Mid(Me.TextBox1.Text, i, 1) & "=" &
Asc(Mid(Me.TextBox1.Text, i, 1))
 Next
 ActiveDocument.Select
 Selection.EndOf wdStory
 Selection.TypeText Me.TextBox1.Text
 End Sub

When I execute this userform, I don't see any square boxes either in
the MsgBox or the Word document. I do see square boxes when the mouse
cursor hovers over Me.TextBox1.Text during execution. The square boxes
represent the Enter key being translated into a carriage return (vbCr)
and a line feed (vbLf) as the CR and LF are "non-printable" characters.
The carriage return and line feed become the start of a new paragrpah
in the Word document.

The for loop show the character and its equivalent decimal value.

If this doesn't help, please post more detail.

Art

> When a user populates a field on a userform and enters a return character,
> the output displays a square box, is there any way to suppress this character
[quoted text clipped - 5 lines]
>
> Thanks in anticipation of your help.

Rate this thread:






 
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.