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 / December 2004

Tip: Looking for answers? Try searching our database.

Infopath Alert

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lanwalker - 15 Dec 2004 01:55 GMT
Step-by-Step
------------
1. Start Infopath 2003.
2. On the File menu, click Design a Form.
3. In the Design a Form task pane, click New Blank Form.
4. To add the following script to your form, follow these steps:
a.  On the Tools menu, point to Script, and then select On Load Event.

Microsoft Script Editor appears.
b.  Replace the OnLoad function with the following code:

JScript
-------
function XDocument::OnLoad(eventObj)
{
debugger;
XDocument.UI.Alert("This is a test.");
}

VBScript
--------
Sub XDocument_OnLoad(eventObj)
Stop
XDocument.UI.Alert "This is a test."
End Sub

c.  Save the script, and then close Script Editor.

5. On the File menu, point to Preview Form, and then click Default.

For more help with infopath programming please contact me at
help@lanwalker.com

Alain Vezina
Andrew Watt [MVP - InfoPath] - 15 Dec 2004 10:50 GMT
>JScript
>-------
[quoted text clipped - 10 lines]
>XDocument.UI.Alert "This is a test."
>End Sub

Ian,

If the above code was intended for beginners (as I assume it was)
having the debugger and Stop statements will, I suggest, confuse those
with little familiarity with the Script Editor debugging. Those most
likely to need such simple scripts are also those most likely not to
understand (fully?) how debugging works in the Script Editor.

XDocument.UI.Alert ("This is a test.")

will work in both VBScript and JScript (add a semicolon in JScript, if
you prefer).

Andrew Watt
MVP - InfoPath
 
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.