Help with userform/textbox 
Author Message
 Help with userform/textbox

OK, Simple question (I hope) I have a .dot that fills in
information on a document, working fine except for 1 small
problem. When a user fills in a textbox & wants to enter
more than 1 line of info they press enter & go to the next
line in the box, ok so far, however, when it transfers to
the document I get an extra character at the beginning of
line 2.
Any idea why?? And how to stop it from happening?

Thanks in advance,
Bill Mlodgenski - Itasca County



Mon, 06 Sep 2004 23:15:45 GMT  
 Help with userform/textbox
The textbox uses the vbcrlf to create an new line when enter is pressed. Vbcrlf
is a carriage return followed by a line feed character. Chr(10) & Chr(13)


Tue, 07 Sep 2004 01:59:58 GMT  
 Help with userform/textbox
Thanks for the info, but how can I get rid of it in the
document? I really don't want little boxes printing in my
completed document..Any ideas?
Is there a way to find/replace those characters after all
the info is inputed?

Thanks again for the quick reply,
Bill Mlodgenski - Itasca County

Quote:
>-----Original Message-----
>The textbox uses the vbcrlf to create an new line when

enter is pressed. Vbcrlf
Quote:
>is a carriage return followed by a line feed character.
Chr(10) & Chr(13)

>.



Tue, 07 Sep 2004 02:14:06 GMT  
 Help with userform/textbox
Chr(13) & Chr(10) are non printable characters they simply format the text. Are
you sure that the 'little boxes' are printable characters? Check the word -
tools. options - view tab to see what non-printable characters are set.

If you are sure that these charachers are actually cahracers that get inserted
into the word document and WILL be printed out then you need to determine where
they come from in the textbox. So it's best to adjust the text in the textbox
prior to sending the text to the document.

Hope this helps
Chris



Wed, 08 Sep 2004 04:20:42 GMT  
 Help with userform/textbox
Thanks for the reply (again). I checked my tools-options -
view & NOTHING is checked for non-printable characters.
However, these are little boxes that will print, they only
show up if you hit "enter" while in the textbox. They then
transfer to the document on the 2nd line of text coming
from the textbox.

Here is the code I am using, nothing complicated about it.
Maybe you can recreate it?
Open a new document, insert a text form field, open visual
basic & make a userform1 , only need a textbox
(enterkey=true & multiline=true)& command button, when
click on the command button, it does this:
Private Sub CommandButton1_Click()
  ' Set the values on the document
     ActiveDocument.FormFields("text1").Result =
UserForm1.TextBox1
UserForm1.Hide
End Sub

Now run the form & insert some text on the first line, hit
enter, type some more text, click the command button  &
the box will appear in the document on the second line

Maybe there is something else I am supposed to do?? Or am
I just crazy..

Thanks for your help,
Bill Mlodgenski - Itasca County

Quote:
>-----Original Message-----
>Thanks for the info, but how can I get rid of it in the
>document? I really don't want little boxes printing in my
>completed document..Any ideas?
>Is there a way to find/replace those characters after all
>the info is inputed?

>Thanks again for the quick reply,
>Bill Mlodgenski - Itasca County

>>-----Original Message-----
>>The textbox uses the vbcrlf to create an new line when
>enter is pressed. Vbcrlf
>>is a carriage return followed by a line feed character.
>Chr(10) & Chr(13)

>>.

>.



Wed, 08 Sep 2004 05:02:18 GMT  
 Help with userform/textbox
Hi Bill,

Do you really need to use a formfield.  If you just insert the text before
the range of a bookmark which is defined as being a single space so that it
looks like [] when view bookmarks is switched on, the text will be inserted
into the bookmark so that it can be cross-referenced if need be.  If you
want the document protected for some other reason, have the code in the
userform apply the protection.

When you use

ActiveDocument.Bookmarks("Text1").Range.InsertBefore TextBox1

you do not get the squares.

Please post any response to the newsgroups for the benefit of others who may
also be following the thread.

Hope this helps,
Doug Robbins - Word MVP

Quote:
> Thanks for the reply (again). I checked my tools-options -
> view & NOTHING is checked for non-printable characters.
> However, these are little boxes that will print, they only
> show up if you hit "enter" while in the textbox. They then
> transfer to the document on the 2nd line of text coming
> from the textbox.

> Here is the code I am using, nothing complicated about it.
> Maybe you can recreate it?
> Open a new document, insert a text form field, open visual
> basic & make a userform1 , only need a textbox
> (enterkey=true & multiline=true)& command button, when
> click on the command button, it does this:
> Private Sub CommandButton1_Click()
>   ' Set the values on the document
>      ActiveDocument.FormFields("text1").Result =
> UserForm1.TextBox1
> UserForm1.Hide
> End Sub

> Now run the form & insert some text on the first line, hit
> enter, type some more text, click the command button  &
> the box will appear in the document on the second line

> Maybe there is something else I am supposed to do?? Or am
> I just crazy..

> Thanks for your help,
> Bill Mlodgenski - Itasca County

> >-----Original Message-----
> >Thanks for the info, but how can I get rid of it in the
> >document? I really don't want little boxes printing in my
> >completed document..Any ideas?
> >Is there a way to find/replace those characters after all
> >the info is inputed?

> >Thanks again for the quick reply,
> >Bill Mlodgenski - Itasca County

> >>-----Original Message-----
> >>The textbox uses the vbcrlf to create an new line when
> >enter is pressed. Vbcrlf
> >>is a carriage return followed by a line feed character.
> >Chr(10) & Chr(13)

> >>.

> >.



Wed, 08 Sep 2004 08:58:10 GMT  
 Help with userform/textbox
Doug,
Thanks for the tip. I tried it on my test document & it
worked! Now I just have to fix my original document, which
has about 30 of these fields to insert.
You guys are the best, thanks for all your help. You just
made the Sheriffs of Itasca County in Minnesota very
happy..

Bill Mlodgenski - Itasca County

Quote:
>-----Original Message-----
>Hi Bill,

>Do you really need to use a formfield.  If you just

insert the text before
Quote:
>the range of a bookmark which is defined as being a

single space so that it
Quote:
>looks like [] when view bookmarks is switched on, the

text will be inserted
Quote:
>into the bookmark so that it can be cross-referenced if
need be.  If you
>want the document protected for some other reason, have
the code in the
>userform apply the protection.

>When you use

>ActiveDocument.Bookmarks("Text1").Range.InsertBefore
TextBox1

>you do not get the squares.

>Please post any response to the newsgroups for the

benefit of others who may
Quote:
>also be following the thread.

>Hope this helps,
>Doug Robbins - Word MVP

in message

>> Thanks for the reply (again). I checked my tools-
options -
>> view & NOTHING is checked for non-printable characters.
>> However, these are little boxes that will print, they
only
>> show up if you hit "enter" while in the textbox. They
then
>> transfer to the document on the 2nd line of text coming
>> from the textbox.

>> Here is the code I am using, nothing complicated about
it.
>> Maybe you can recreate it?
>> Open a new document, insert a text form field, open
visual
>> basic & make a userform1 , only need a textbox
>> (enterkey=true & multiline=true)& command button, when
>> click on the command button, it does this:
>> Private Sub CommandButton1_Click()
>>   ' Set the values on the document
>>      ActiveDocument.FormFields("text1").Result =
>> UserForm1.TextBox1
>> UserForm1.Hide
>> End Sub

>> Now run the form & insert some text on the first line,
hit
>> enter, type some more text, click the command button  &
>> the box will appear in the document on the second line

>> Maybe there is something else I am supposed to do?? Or
am
>> I just crazy..

>> Thanks for your help,
>> Bill Mlodgenski - Itasca County

>> >-----Original Message-----
>> >Thanks for the info, but how can I get rid of it in the
>> >document? I really don't want little boxes printing in
my
>> >completed document..Any ideas?
>> >Is there a way to find/replace those characters after
all
>> >the info is inputed?

>> >Thanks again for the quick reply,
>> >Bill Mlodgenski - Itasca County

>> >>-----Original Message-----
>> >>The textbox uses the vbcrlf to create an new line when
>> >enter is pressed. Vbcrlf
>> >>is a carriage return followed by a line feed
character.
>> >Chr(10) & Chr(13)

>> >>.

>> >.

>.



Sat, 11 Sep 2004 02:55:27 GMT  
 Help with userform/textbox
Hi Bill,

I'll remember that next time I get a citation in Itasca County (if I ever
find out where it is) <g>

Please post any response to the newsgroups for the benefit of others who may
also be following the thread.

Hope this helps,
Doug Robbins - Word MVP

Quote:
> Doug,
> Thanks for the tip. I tried it on my test document & it
> worked! Now I just have to fix my original document, which
> has about 30 of these fields to insert.
> You guys are the best, thanks for all your help. You just
> made the Sheriffs of Itasca County in Minnesota very
> happy..

> Bill Mlodgenski - Itasca County

> >-----Original Message-----
> >Hi Bill,

> >Do you really need to use a formfield.  If you just
> insert the text before
> >the range of a bookmark which is defined as being a
> single space so that it
> >looks like [] when view bookmarks is switched on, the
> text will be inserted
> >into the bookmark so that it can be cross-referenced if
> need be.  If you
> >want the document protected for some other reason, have
> the code in the
> >userform apply the protection.

> >When you use

> >ActiveDocument.Bookmarks("Text1").Range.InsertBefore
> TextBox1

> >you do not get the squares.

> >Please post any response to the newsgroups for the
> benefit of others who may
> >also be following the thread.

> >Hope this helps,
> >Doug Robbins - Word MVP

> in message

> >> Thanks for the reply (again). I checked my tools-
> options -
> >> view & NOTHING is checked for non-printable characters.
> >> However, these are little boxes that will print, they
> only
> >> show up if you hit "enter" while in the textbox. They
> then
> >> transfer to the document on the 2nd line of text coming
> >> from the textbox.

> >> Here is the code I am using, nothing complicated about
> it.
> >> Maybe you can recreate it?
> >> Open a new document, insert a text form field, open
> visual
> >> basic & make a userform1 , only need a textbox
> >> (enterkey=true & multiline=true)& command button, when
> >> click on the command button, it does this:
> >> Private Sub CommandButton1_Click()
> >>   ' Set the values on the document
> >>      ActiveDocument.FormFields("text1").Result =
> >> UserForm1.TextBox1
> >> UserForm1.Hide
> >> End Sub

> >> Now run the form & insert some text on the first line,
> hit
> >> enter, type some more text, click the command button  &
> >> the box will appear in the document on the second line

> >> Maybe there is something else I am supposed to do?? Or
> am
> >> I just crazy..

> >> Thanks for your help,
> >> Bill Mlodgenski - Itasca County

> >> >-----Original Message-----
> >> >Thanks for the info, but how can I get rid of it in the
> >> >document? I really don't want little boxes printing in
> my
> >> >completed document..Any ideas?
> >> >Is there a way to find/replace those characters after
> all
> >> >the info is inputed?

> >> >Thanks again for the quick reply,
> >> >Bill Mlodgenski - Itasca County

> >> >>-----Original Message-----
> >> >>The textbox uses the vbcrlf to create an new line when
> >> >enter is pressed. Vbcrlf
> >> >>is a carriage return followed by a line feed
> character.
> >> >Chr(10) & Chr(13)

> >> >>.

> >> >.

> >.



Sat, 11 Sep 2004 17:09:15 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Userform: populate textbox with date from another textbox

2. Basic (!) userform query - greying out of textboxes

3. datetimeformat in userform.textbox

4. UserForms, Textboxes & Bookmarks

5. Userforms - populating textboxes

6. Invoking autocorrect from textbox on a userform

7. Greying out textboxes in a userform

8. Focus and textboxes on vba userforms

9. Looping thru Textboxes in Userform

10. Unloading an array to TextBoxes on a UserForm

11. Populate userform textboxes with bookmarks

12. Updating textboxes in Word using UserForms fields

 

 
Powered by phpBB® Forum Software