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 / General MS InfoPath Questions / August 2005

Tip: Looking for answers? Try searching our database.

Rich Text Box Event Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Burke - 12 Aug 2005 00:10 GMT
I would like to have a rich text box with default text that becomes selected
when the user enters the field.

Is this possible?

Thanks
Scott L. Heim [MSFT] - 12 Aug 2005 14:07 GMT
Hi Bill,

As InfoPath is completely data driven you do not have programmatic access
to the controls on your View. As such, there is not, as an example, an
"OnFocus" event that will fire as you select a control.

Now with that said, there is a way to select text in specific controls so
if you wanted to allow your users to, say, click a button and set focus to
your Rich Text box, this could be done. (Another option may be where a user
makes a selection from a drop-down list box and then your code would move
the focus to the Rich Text box.)

Here is sample VBScript code that will set focus to a Rich Text control on
my form named field1:

    Dim objRichTextBox
    Set objRichTextBox =
XDocument.DOM.selectSingleNode("//my:myFields/my:field1")
    XDocument.View.SelectText objRichTextBox

I hope this helps!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
 
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.