Multiline in a textbox in outlook

G

Guest

hello!

I have a textbox in a userform I wrote in VBA in outlook.
I want people to be able to write a message of a few lines in the textbox.
The property Multiline is TRUE, but still, when I press 'enter' it goes to
different controls and does not go to the next line.
How can I fix it?

Thanks,
Yonina.
 
K

Ken Slovak - [MVP - Outlook]

Use Ctrl+Enter to enter a newline and remain within that control.
 
G

Guest

Yes, it works, but I can't ask the people here (users) to use Ctrl+Enter
every time they want to enter a newline. Is there a way to fix it in the code?
 
K

Ken Slovak - [MVP - Outlook]

Use the Advanced Properties property page and set the EnterKeyBehavior
Boolean to True. That will do what you want.

The behavior of that property is described in the help for MS Forms 2.0,
which is the control set used in Outlook forms. You can add a reference to
that library in your Outlook VBA project so you can use the Object Browser
and Object Browser Help with it.

From that Help on EnterKeyBehavior:

The EnterKeyBehavior and MultiLine properties are closely related. The
values described above only apply if MultiLine is True. If MultiLine is
False, pressing ENTER always moves the focus to the next control in the tab
order regardless of the value of EnterKeyBehavior.

The effect of pressing CTRL+ENTER also depends on the value of MultiLine. If
MultiLine is True, pressing CTRL+ENTER creates a new line regardless of the
value of EnterKeyBehavior. If MultiLine is False, pressing CTRL+ENTER has no
effect.
 
G

Guest

THANK YOU!!!
IT WORKS!!!

:) :) :)

Ken Slovak - said:
Use the Advanced Properties property page and set the EnterKeyBehavior
Boolean to True. That will do what you want.

The behavior of that property is described in the help for MS Forms 2.0,
which is the control set used in Outlook forms. You can add a reference to
that library in your Outlook VBA project so you can use the Object Browser
and Object Browser Help with it.

From that Help on EnterKeyBehavior:

The EnterKeyBehavior and MultiLine properties are closely related. The
values described above only apply if MultiLine is True. If MultiLine is
False, pressing ENTER always moves the focus to the next control in the tab
order regardless of the value of EnterKeyBehavior.

The effect of pressing CTRL+ENTER also depends on the value of MultiLine. If
MultiLine is True, pressing CTRL+ENTER creates a new line regardless of the
value of EnterKeyBehavior. If MultiLine is False, pressing CTRL+ENTER has no
effect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top