1 2 3 4 5 6 7 8 9
|
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01039179"><META NAME="lcid" CONTENT="1033"><title>About programming InfoPath</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><p id="ExpandAllLine" class="ExpFav"><a href="#" onclick="ExpandAll()" onkeypress="ExpandAll()" class="DropDown"><img id="picHeader" border="0" src="expandtri.gif" alt="Show All"><span id="ExpandAll">Show All</span></a></p><h1>About programming InfoPath</h1><div class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="specifics" onclick="toggleList()" onkeypress="toggleList()"></span></div><p>Microsoft Office InfoPath 2003 provides developers with a rich development environment for customizing forms. Forms can be customized by writing programming code to respond to form and <a href="#" class="glossary" onclick="AppendPopup(this,'xddatavalidation')" onkeypress="AppendPopup(this,'xddatavalidation')">data validation</a> events, to access and manipulate a form's underlying XML document, to implement custom data submission and merges, and to implement access to external data sources. Customizing a form can also involve altering one of the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformfiles')" onkeypress="AppendPopup(this,'xdformfiles')">form files</a> to suit a specific requirement.</p><p>It is important to understand a few key concepts that are involved in programming an InfoPath form. These concepts include the InfoPath programming components, programmatic and declarative programming, the InfoPath programming languages, and the InfoPath programming environment.</p><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">InfoPath programming components</a></p><div id="ExpCol" class="collapsed" border="0"><p>InfoPath programmability involves customizing an InfoPath form by altering its form files or by writing scripting code to create custom functions using the InfoPath object model. The main components of an InfoPath form that can involve programmatic interaction are listed in the following table.</p><table><tr><th>Component</th><th>Description</th></tr><tr><td>Object model</td><td>A robust, hierarchical type library composed of collections, objects, properties, methods, and events that give form developers programmatic control over various aspects of the InfoPath editing environment and access to a form's underlying XML document.</td></tr><tr><td>Data validation</td><td>A combination of <a href="#" class="glossary" onclick="AppendPopup(this,'OfXmlSchemas')" onkeypress="AppendPopup(this,'OfXmlSchemas')">XML Schemas</a>, expressions, and scripting code used to validate and constrain the data that users are allowed to enter in a form.</td></tr><tr><td>Event handling</td><td>A set of <a href="#" class="glossary" onclick="AppendPopup(this,'xdeventhandler')" onkeypress="AppendPopup(this,'xdeventhandler')">event handlers</a> that respond to changes to a form's underlying XML document, respond to view switching, implement custom form submission, or respond to the loading of the form's underlying XML document.</td></tr><tr><td>User interface</td><td>A set of customizable user interface components that includes menus, toolbars, buttons, command bars, and a task pane.</td></tr><tr><td>Editing controls</td><td>A set of InfoPath-specific controls used to manage and interact with the form's underlying XML document that includes collections, optional items, text lists, and fields.</td></tr><tr><td>Error handling</td><td>A combination of event handlers, object model calls, and <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition (.xsf) file</a> entries that are used to handle errors in an InfoPath form.</td></tr><tr><td>Security</td><td>A set of security levels that restrict access to the InfoPath object model and system resources.</td></tr><tr><td>Data submission</td><td>A set of predefined functions that can be used to implement custom posting and submission functionality for an InfoPath form.</td></tr><tr><td>Business logic</td><td>A set of custom scripting files that contain programming code used to implement specific editing behavior, data validation, event handlers, and control of data flow. Business logic can also include accessing of external <a href="#" class="glossary" onclick="AppendPopup(this,'ofcomponentobjectmodelcom')" onkeypress="AppendPopup(this,'ofcomponentobjectmodelcom')">Component Object Model (COM)</a> components.</td></tr><tr><td>Form integration</td><td>Integration of other Microsoft Office applications such as Microsoft Excel or Microsoft Outlook. Integration may also involve the use of back-end servers such as Microsoft SQL Server, Microsoft Windows SharePoint Services, or XML Web services.</td></tr></table></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Programmatic and declarative development</a></p><div id="ExpCol" class="collapsed" border="0"><p>When you alter the InfoPath form files, you customize the form declaratively<nbsp />— that is, you open the form files in some type of standard text editor and manually change the elements, attributes, and values of the files. When you alter a form programmatically, you write programming code using a scripting language in conjunction with the InfoPath object model and, in some cases, <a href="#" class="glossary" onclick="AppendPopup(this,'ofcomponentobjectmodelcom')" onkeypress="AppendPopup(this,'ofcomponentobjectmodelcom')">Component Object Model (COM)</a> components to extend and enhance form behavior.</p><p>The following are some of the ways in which a form may be customized declaratively:</p><ul><li>Modifying the <a href="#" class="glossary" onclick="AppendPopup(this,'OfXmlSchemas')" onkeypress="AppendPopup(this,'OfXmlSchemas')">XML Schema</a> (.xsd) files</li><li>Modifying the <a href="#" class="glossary" onclick="AppendPopup(this,'xdview')" onkeypress="AppendPopup(this,'xdview')">view</a> (.xsl) files created in <a href="#" class="glossary" onclick="AppendPopup(this,'xddesignmode')" onkeypress="AppendPopup(this,'xddesignmode')">design mode</a></li><li>Modifying the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition (.xsf) file</a></li><li>Modifying the <a href="#" class="glossary" onclick="AppendPopup(this,'xdxmltemplatefile')" onkeypress="AppendPopup(this,'xdxmltemplatefile')">XML template (.xml) file</a></li></ul><p>The following are some of the ways in which a form may be customized programmatically:</p><ul><li>Adding form lifecycle processing logic</li><li>Adding custom data validation</li><li>Adding custom error handling</li><li>Implementing data submission</li><li>Responding to a form merge (or import)</li><li>Using <a href="#" class="glossary" onclick="AppendPopup(this,'xdcustomtaskpane')" onkeypress="AppendPopup(this,'xdcustomtaskpane')">custom task panes</a></li><li>Using custom dialog boxes</li><li>Accessing and modifying a form's underlying XML document</li><li>Accessing and modifying the form definition file</li><li>Using external COM components</li></ul></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">InfoPath programming languages and the programming environment</a></p><div id="ExpCol" class="collapsed" border="0"><p>Like other Microsoft Office applications, InfoPath provides a programming environment and programming languages that developers can use to automate and extend their Office applications. However, while most Office applications use <a href="#" class="glossary" onclick="AppendPopup(this,'ofVBA')" onkeypress="AppendPopup(this,'ofVBA')">Microsoft Visual Basic for Applications (VBA)</a> as their primary programming language, InfoPath uses two scripting languages<nbsp />— Microsoft <a href="#" class="glossary" onclick="AppendPopup(this,'ofjscript')" onkeypress="AppendPopup(this,'ofjscript')">JScript</a> and Microsoft <a href="#" class="glossary" onclick="AppendPopup(this,'ofVBScript')" onkeypress="AppendPopup(this,'ofVBScript')">VBScript</a>. In addition, the programming environment that is used when writing programming code in InfoPath is the <a href="#" class="glossary" onclick="AppendPopup(this,'xdmicrosoftscripteditormse')" onkeypress="AppendPopup(this,'xdmicrosoftscripteditormse')">Microsoft Script Editor (MSE)</a>, not the <a href="#" class="glossary" onclick="AppendPopup(this,'ofVisualBasicEditor')" onkeypress="AppendPopup(this,'ofVisualBasicEditor')">Visual Basic Editor</a>.</p><p><b>Note</b> If you have Microsoft Visual Studio .NET 2003, you can use the Microsoft Office InfoPath 2003 Toolkit for Visual Studio .NET to create InfoPath projects using managed code. For more information on using Visual Studio .NET to create InfoPath projects, see the documentation installed with the InfoPath 2003 Toolkit for Visual Studio .NET. For information on how to download the InfoPath 2003 Toolkit for Visual Studio .NET, see the <a href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT011268791033&CTT=11&Origin=HV010391791033" target="_new">InfoPath Developer Page on Office Developer Center</a>. </p></div><script type="text/javascript" language="JScript" src="ofvbanl.js"></script><span id="ofVBAISpan" class="ofvbaispan"><iframe id="ofVBAIFrame" frameborder="0" marginheight="0" marginwidth="4" scrolling="auto" width="100%" src="../links/inconAboutProgrammingIP_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">©2003-2004 Microsoft Corporation. All rights reserved.</a>
Permission to copy, display and distribute this document is available at: <a
href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&CTT=11&Origin=HV011232471033"
target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>
|