<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lotushints &#187; import</title>
	<atom:link href="http://www.lotushints.com/tag/import/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lotushints.com</link>
	<description>Lotus Notes tips &#38; tricks you always hoped you will not need</description>
	<lastBuildDate>Thu, 29 Dec 2011 09:47:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Custom web forms &#8211; Part 2: Importing Form from DXL</title>
		<link>http://www.lotushints.com/2009/03/custom-web-forms-part-2-importing-form-from-dxl/</link>
		<comments>http://www.lotushints.com/2009/03/custom-web-forms-part-2-importing-form-from-dxl/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 08:00:47 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Basic]]></category>
		<category><![CDATA[Custom forms]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[dxl]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[import]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=260</guid>
		<description><![CDATA[In the second part of Custom web forms series I will try to cover import of simple form to Notes database from DXL file. If you wonder how to export a form to DXL, please check Part 1: Exporting Form into DXL. Requirements As mentioned, you will need a DXL file like the result of [...]]]></description>
			<content:encoded><![CDATA[<p>In the second part of <a href="/category/custom-forms/">Custom web forms series</a> I will try to cover import of simple form to Notes database from DXL file. If you wonder how to export a form to DXL, please check <a href="/2009/03/custom-web-forms-part-1-exporting-form-into-dxl/">Part 1: Exporting Form into DXL</a>.<br />
<span id="more-260"></span></p>
<p><strong>Requirements</strong></p>
<p>As mentioned, you will need a DXL file like the result of <a href="/2009/03/custom-web-forms-part-1-exporting-form-into-dxl/">Part 1</a>. Beware that, if you have altered the file and removed the DOCTYPE tag, you will not be able to import DXL and you will either need to add correct DOCTYPE tag back or export the form again.</p>
<p><strong>The code</strong></p>
<p>The code itself is pretty straightforward. You need to open a DXL file as a NotesStream object and then use NotesDXLImporter class to import a DXL to your database. There is a catch. You need to set <strong>DesignImportOption</strong> property of NotesDXLImporter object to create design element. These options are specified in Notes Designer Help.</p>
<pre>Dim session As New NotesSession
Dim dbCurr As NotesDatabase
Dim docForm As NotesDocument
Dim stream As NotesStream
Dim dxlImporter As NotesDXLImporter
Dim strFile As String

Set dbCurr = session.CurrentDatabase
Set stream = session.CreateStream ()

strFile = "c:\download\templateform.xml"
If (Not stream.Open (strFile, "utf-8")) Then
   Exit Sub
End If

Set dxlImporter = session.CreateDXLImporter (stream, dbCurr)
dxlImporter.DesignImportOption =_
DXLIMPORTOPTION_REPLACE_ELSE_CREATE
Call dxlImporter.Process ()</pre>
<p>Just in case you don&#8217;t want to check Notes help for values, here are DXL import options:</p>
<ul>
<li> DXLIMPORTOPTION_CREATE (1)</li>
<li> DXLIMPORTOPTION_IGNORE (2)</li>
<li> DXLIMPORTOPTION_REPLACE_ELSE_IGNORE (5)</li>
<li> DXLIMPORTOPTION_REPLACE_ELSE_CREATE (6)</li>
<li> DXLIMPORTOPTION_UPDATE_ELSE_IGNORE (9)</li>
<li> DXLIMPORTOPTION_UPDATE_ELSE_CREATE (10)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/03/custom-web-forms-part-2-importing-form-from-dxl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

