• 0

Need help on a vbscript using loop count in variable name


Question

Hello, 

 

I need to utilize a loop count as part of a variable name within vbscript.  For the life of me, I cannot figure it out.

For example, below I need objrecord1, objrecord2, etc.

for each q in FILE 
Set objrecord + q needed here = xmlDoc.createElement("document")  
objRecord0.appendchild objrecord +q

Much Thanks!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I'm confused, why can't you just use a regular for loop instead of a foreach or if you need the foreach (for each line of the file), why can't you create a variable and increment it yourself?

Link to comment
Share on other sites

  • 0

I'm confused, why can't you just use a regular for loop instead of a foreach or if you need the foreach (for each line of the file), why can't you create a variable and increment it yourself?

FILE  is an array, populated by a comma del string from third party software.  

 

The real problem comes down to objrecord.  It is within a loop and will error on the second instance as it already exists.  I don't believe I can set it to nothing, then loop.  The entire script is building an xml, which saves at the end.  

 

What does work is objrecord1, objrecord2, etc. I tested this by removing the loop and writing two document entries. However, the loop contains a good 100 lines of code for index fields per doc and we expect anywhere from 2 to 15 documents.

Link to comment
Share on other sites

  • 0

This code works (one document code shown, minus 90% of the indexes).  For document 2, I would need to increase the value of each objrecord which has a value at its end (Else, the entry is either applied to the wrong place or overwrites).  So document 2 would need objrecord4,5, & 6, etc.

Sub XMLBuilder1_OnLoad
	Set xmlDoc = CreateObject("Microsoft.XMLDOM")
	
	Set objRoot = xmlDoc.createElement("batch")  
	xmlDoc.appendChild objRoot
	
	'' -- start of header -- ''
	
	Set objRecord = xmlDoc.createElement("header")  
	objRoot.appendChild objRecord
	
	Set objName = xmlDoc.createElement("batchid")  
	objName.Text = "" & KOID
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("date")  
	objName.Text = "1/1/2014"
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("user")  
	objName.Text = "ABC"
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("docbase")  
	objName.Text = "DEF"
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("source")  
	objName.Text = "Outlook"
	objRecord.appendChild objName
	
	'' -- end of header - start body section -- ''
	
	Set objRecord0 = xmlDoc.createElement("body")  
	objRoot.appendchild objRecord0
	
	If File_Count > 0 Then '' create first document

		Set objrecord1 = xmlDoc.createElement("document")  
		objRecord0.appendchild objrecord1
		
		Set objName = xmlDoc.createElement("name")
		objName.Text = "NEW-" &Date_Requested &"-" &Country &"." &Ext1
		objRecord1.appendChild objName
		
		Set objName = xmlDoc.createElement("path")  
		objName.Text = "/ACTIVE"
		objRecord.appendChild objName
		
		'' -- Doctype level data -- ''
		Set objrecord2 = xmlDoc.createElement("doctype")  
		objRecord1.appendchild objRecord2
		
		Set objName = xmlDoc.createElement("tname")  
		objName.Text = "lcif2"
		objRecord2.appendChild objName
		
		Set objrecord = xmlDoc.createElement("index")  
		objrecord2.appendchild objrecord
		
		
		'' -- begin content section here -- ''
		
		Set objrecord3 = xmlDoc.createElement("content")  
		objrecord1.appendchild objRecord3
		
		Set objrecord = xmlDoc.createElement("file")  
		objrecord3.appendchild objRecord
		
		Set objName = xmlDoc.createElement("fname")
		objName.Text = "" &File1 
		objRecord.appendChild objName
		
		Set objName = xmlDoc.createElement("format")
		objName.Text = "" & Ext1
		objRecord.appendChild objName
		
		end if
		
	xmlDoc.Save "C:\Send to upload\Upload\LCIF\" & KOID & "\batch.xml"
End Sub

This is code for one of four doctypes.  My goal is to combine all four into one code, and accept infinite number of documents, but I'm stuck at how to apply the x,y,z values into the variable.  This is the full code I'm stuck on:

Sub XMLBuilder_ALL_OnLoad
	Set xmlDoc = CreateObject("Microsoft.XMLDOM")
	
	Set objRoot = xmlDoc.createElement("batch")  
	xmlDoc.appendChild objRoot


	'' -- BUILD ARRAYS -- ''
	FILE = ARRAY( ""&FILES )
	EXT = ARRAY( ""&EXT )
	EXT2 = ARRAY( ""&EXT )


	'' -- DATA CLEAN UP --''
	if JOB = "Data Adjustment" or JOB = "Replacement Recognition" then 
		Date_Requested = Replace(Date_Requested,"/","")
	end if
	if JOB <> "Replacement Recognition" then
		Date_Needed = Replace(Date_Needed,"/","")
	end if
	if JOB <> "Data Adjustment" then
		Date_Received = Replace(Date_Received,"/","")
	end if


	'' -- EXTENSION CLEANUP
	for each x in EXT2
		EXT(x) = replace(EXT(x),".","")
		EXT2(x) = replace(EXT2(x),".","")
		if EXT2(x) = "html" then EXT2(x) = "htm"
		if EXT2(x) = "docx" then EXT2(x) = "msw12"
		if EXT2(x) = "doc" then EXT2(x) = "msw8"
		if EXT2(x) = "xls" then EXT2(x) = "excel8book"
		if EXT2(x) = "xlsx" then EXT2(x) = "excel12book"
		if EXT2(x) = "txt" then EXT2(x) = "crtext"
		if EXT2(x) = "jpg" then EXT2(x) = "jpeg"
		if EXT2(x) = "ppt" then EXT2(x) = "ppt8"
		if EXT2(x) = "docx" then EXT2(x) = "msw12"
		if EXT2(x) = "wpd" then EXT2(x) = "wp8"
		if EXT2(x) = "psd" then EXT2(x) = "photoshop6"
		if EXT2(x) = "au" then EXT2(x) = "audio"
		if EXT2(x) = "ai" then EXT2(x) = "illustrator10"
	next

	
	'' -- start of header -- ''
	
	Set objRecord = xmlDoc.createElement("header")  
	objRoot.appendChild objRecord
	
	Set objName = xmlDoc.createElement("batchid")  
	objName.Text = "" & KOID
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("date")  
	objName.Text = "1/1/2014"
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("user")  
	objName.Text = "karora"
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("docbase")  
	objName.Text = "LCIF"
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("source")  
	objName.Text = "Outlook"
	objRecord.appendChild objName
	
	'' -- end of header - start body section -- ''
	
	Set objRecord0 = xmlDoc.createElement("body")  
	objRoot.appendchild objRecord0


	x=1
	y=2
	z=3	
	for each q in FILE 


		Set objrecord(x) = xmlDoc.createElement("document")  
		objRecord0.appendchild objrecord(x)
		
		Set objName = xmlDoc.createElement("name")
		if JOB = "Data Adjustment" then objName.Text = "NEW-" &Date_Requested &"-" &Country &"." &EXT(q)
		if JOB = "Pending Donation" then objName.Text = "NEW-" &Country &"-" &Date_Received &"." &EXT(q)
		if JOB = "Pending Recognition" then objName.Text = "NEW-" &Country &"-" &State &"-" &Date_Received &"." &EXT(q)
		if JOB = "Replacement Recognition" then objName.Text = "NEW-" &Date_Requested &"-" &Country &"." &EXT(q)
		objRecord(x).appendChild objName
		
		Set objName = xmlDoc.createElement("title")  
		objName.Text = ""
		objRecord(x).appendChild objName
		
		Set objName = xmlDoc.createElement("desc")  
		objName.Text = ""
		objRecord(x).appendChild objName
		
		Set objName = xmlDoc.createElement("keywords")  
		objName.Text = ""
		objRecord(x).appendChild objName
		
		Set objName = xmlDoc.createElement("authors")  
		objName.Text = "karora"
		objRecord(x).appendChild objName
		
		Set objName = xmlDoc.createElement("securitykey")  
		objName.Text = "LCIF"
		objRecord(x).appendChild objName
		
		Set objrecord = xmlDoc.createElement("folderlinks")  
		objRecord(x).appendchild objRecord
		
		Set objName = xmlDoc.createElement("path")  
		objName.Text = "/ACTIVE"
		objRecord.appendChild objName
		
		'' -- Doctype level data -- ''
		Set objrecord(y) = xmlDoc.createElement("doctype")  
		objRecord(x).appendchild objRecord(y)
		
		Set objName = xmlDoc.createElement("tname")  
		objName.Text = "lcif2"
		objRecord(y).appendChild objName
		
		Set objrecord = xmlDoc.createElement("index")  
		objrecord(y).appendchild objrecord
		
		Set objName = xmlDoc.createElement("iname")  
		objName.Text = "DocumentCategory"
		objRecord.appendChild objName
		
		Set objName = xmlDoc.createElement("ivalue")  
		objName.Text = "Pending"
		objRecord.appendChild objName
		
		Set objrecord = xmlDoc.createElement("index")  
		objrecord(y).appendchild objrecord
		
		Set objName = xmlDoc.createElement("iname")  
		objName.Text = "StatusCode"
		objRecord.appendChild objName
		
		Set objName = xmlDoc.createElement("ivalue")  
		objName.Text = "New"
		objRecord.appendChild objName
		
		Set objrecord = xmlDoc.createElement("index")  
		objRecord(y).appendchild objRecord
		
		Set objName = xmlDoc.createElement("iname")  
		objName.Text = "DocClass"
		objRecord.appendChild objName
		
		Set objName = xmlDoc.createElement("ivalue")  
		objName.Text = "" &JOB
		objRecord.appendChild objName
		
		Set objrecord = xmlDoc.createElement("index")  
		objRecord(y).appendchild objRecord
		
		Set objName = xmlDoc.createElement("iname")  
		objName.Text = "Country"
		objRecord.appendChild objName
		
		Set objName = xmlDoc.createElement("ivalue")  
		objName.Text = ""&Country
		objRecord.appendChild objName
		
		if JOB <> "Replacement Recognition" then
			Set objrecord = xmlDoc.createElement("index")  
			objRecord(y).appendchild objRecord
		
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Date Needed"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = ""&Date_Needed
			objRecord.appendChild objName

			Set objrecord = xmlDoc.createElement("index")  
			objRecord(y).appendchild objRecord
		end if
		
		if JOB = "Data Adjustment" or JOB = "Replacement Recognition" then	
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Date Requested"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = ""&Date_Requested
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objRecord(y).appendchild objRecord
		end if

		if JOB <> "Data Adjustment" then	
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Date Received"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = ""&Date_Received
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objRecord(y).appendchild objRecord
		end if

		if JOB = "Pending Recognition" then	
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "State"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = ""&State
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objRecord(y).appendchild objRecord
		end if

		if JOB = "Data Adjustment" then	

			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Order ID"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = "" & Order_ID
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objRecord(y).appendchild objRecord
		
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "LCIFBatch"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = "" &Batch_ID
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objRecord(y).appendchild objRecord
		
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Type of Adjustment"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = "" &Type_Of_Adjustment
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objRecord(y).appendchild objRecord
		
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Correct Data To"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = "" &Correct_Data_To
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objRecord(y).appendchild objRecord
		
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Notes"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = "" &Notes
			objRecord.appendChild objName
		end if
			'' -- begin content section here -- ''
		
		Set objrecord(z) = xmlDoc.createElement("content")  
		objrecord(x).appendchild objRecord(z)
		
		Set objrecord = xmlDoc.createElement("file")  
		objrecord(z).appendchild objRecord
		
		Set objName = xmlDoc.createElement("fname")
		objName.Text = "" &FILE(q) 
		objRecord.appendChild objName
		
		Set objName = xmlDoc.createElement("format")
		objName.Text = "" & EXT2(q)
		objRecord.appendChild objName

	x=x+3
	y=y+3
	z=z+3
		
	next
	
	xmlDoc.Save "C:\Send to Docmall\Upload\LCIF\" & KOID & "\batch.xml"
End Sub
 
Link to comment
Share on other sites

  • 0

I figured it out....

Sub XMLBuilder_ALL_OnLoad
	Set xmlDoc = CreateObject("Microsoft.XMLDOM")
	
	Set objRoot = xmlDoc.createElement("batch")  
	xmlDoc.appendChild objRoot


	'' -- BUILD ARRAYS -- ''
	FILE = split(""&FILES,",")
	EXT = split (""&EXT,",")
	EXT2 = EXT
	
	''-- convert array EXT2 for Documentum -- ''
	For q = 0 To ubound(EXT2)
		If EXT2(q) = ".pdf" Then EXT2(q) = "pdf"
		If EXT2(q) = ".html" Then EXT2(q) = "htm"
		If EXT2(q) = ".docx" Then EXT2(q) = "msw12"
		If EXT2(q) = ".doc" Then EXT2(q) = "msw8"
		If EXT2(q) = ".xls" Then EXT2(q) = "excel8book"
		If EXT2(q) = ".xlsx" Then EXT2(q) = "excel12book"
		If EXT2(q) = ".txt" Then EXT2(q) = "crtext"
		If EXT2(q) = ".jpg" Then EXT2(q) = "jpeg"
		If EXT2(q) = ".ppt" Then EXT2(q) = "ppt8"
		If EXT2(q) = ".pptx" Then EXT2(q) = "ppt12"
		If EXT2(q) = ".wpd" Then EXT2(q) = "wp8"
		If EXT2(q) = ".psd" Then EXT2(q) = "photoshop6"
		If EXT2(q) = ".au" Then EXT2(q) = "audio"
		If EXT2(q) = ".ai" Then EXT2(q) = "illustrator10" 
	Next

	'' -- DATA CLEAN UP --''
	If JOB = "Data Adjustment" Or JOB = "Replacement Recognition" Then 
		Date_Requested = Replace(Date_Requested,"/","")
	End If
	If JOB <> "Replacement Recognition" Then
		Date_Needed = Replace(Date_Needed,"/","")
	End If
	If JOB <> "Data Adjustment" Then
		Date_Received = Replace(Date_Received,"/","")
	End If
	
	'' -- start of header -- ''
	
	Set objRecord = xmlDoc.createElement("header")  
	objRoot.appendChild objRecord
	
	Set objName = xmlDoc.createElement("batchid")  
	objName.Text = "" & KOID
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("date")  
	objName.Text = "1/1/2014"
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("user")  
	objName.Text = "karora"
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("docbase")  
	objName.Text = "LCIF"
	objRecord.appendChild objName
	
	Set objName = xmlDoc.createElement("source")  
	objName.Text = "Outlook"
	objRecord.appendChild objName
	
	'' -- end of header - start body section -- ''
	
	Set objRecord0 = xmlDoc.createElement("body")  
	objRoot.appendchild objRecord0

	For q = 0 To ubound(FILE)

		Set objdoc = xmlDoc.createElement("document")
		objRecord0.appendchild objdoc

		Set objName = xmlDoc.createElement("name")
		If JOB = "Data Adjustment" Then objName.Text = "NEW-" &Date_Requested &"-" &Country &EXT(q)
		If JOB = "Pending Donation" Then objName.Text = "NEW-" &Country &"-" &Date_Received &EXT(q)
		If JOB = "Pending Recognition" Then objName.Text = "NEW-" &Country &"-" &State &"-" &Date_Received &EXT(q)
		If JOB = "Replacement Recognition" Then objName.Text = "NEW-" &Date_Requested &"-" &Country &EXT(q)
		ObjName.text = replace(ObjName.text,".html",".htm")
		objdoc.appendChild objName
		
		Set objName = xmlDoc.createElement("title")  
		objName.Text = ""
		objdoc.appendChild objName
		
		Set objName = xmlDoc.createElement("desc")  
		objName.Text = ""
		objdoc.appendChild objName
		
		Set objName = xmlDoc.createElement("keywords")  
		objName.Text = ""
		objdoc.appendChild objName
		
		Set objName = xmlDoc.createElement("authors")  
		objName.Text = "karora"
		objdoc.appendChild objName
		
		Set objName = xmlDoc.createElement("securitykey")  
		objName.Text = "LCIF"
		objdoc.appendChild objName
		
		Set objrecord = xmlDoc.createElement("folderlinks")  
		objdoc.appendchild objRecord
		
		Set objName = xmlDoc.createElement("path")  
		objName.Text = "/ACTIVE"
		objRecord.appendChild objName
		
		'' -- Doctype level data -- ''
		Set objtype = xmlDoc.createElement("doctype")  
		objdoc.appendchild objtype
		
		Set objName = xmlDoc.createElement("tname")  
		objName.Text = "lcif2"
		objtype.appendChild objName
		
		Set objrecord = xmlDoc.createElement("index")  
		objtype.appendchild objrecord
		
		Set objName = xmlDoc.createElement("iname")  
		objName.Text = "DocumentCategory"
		objRecord.appendChild objName
		
		Set objName = xmlDoc.createElement("ivalue")  
		objName.Text = "Pending"
		objRecord.appendChild objName
		
		Set objrecord = xmlDoc.createElement("index")  
		objtype.appendchild objrecord
		
		Set objName = xmlDoc.createElement("iname")  
		objName.Text = "StatusCode"
		objRecord.appendChild objName
		
		Set objName = xmlDoc.createElement("ivalue")  
		objName.Text = "New"
		objRecord.appendChild objName
		
		Set objrecord = xmlDoc.createElement("index")  
		objtype.appendchild objRecord
		
		Set objName = xmlDoc.createElement("iname")  
		objName.Text = "DocClass"
		objRecord.appendChild objName
		
		Set objName = xmlDoc.createElement("ivalue")  
		objName.Text = "" &JOB
		objRecord.appendChild objName
		
		Set objrecord = xmlDoc.createElement("index")  
		objtype.appendchild objRecord
		
		Set objName = xmlDoc.createElement("iname")  
		objName.Text = "Country"
		objRecord.appendChild objName
		
		Set objName = xmlDoc.createElement("ivalue")  
		objName.Text = ""&Country
		objRecord.appendChild objName
		
		If Not (JOB = "Replacement Recognition") Then
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
		
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Date Needed"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = ""&Date_Needed
			objRecord.appendChild objName

			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
		End If
		
		
		
		If JOB = "Data Adjustment" Or JOB = "Replacement Recognition" Then
			
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
			
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Date Requested"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = ""&Date_Requested
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
		End If

		If JOB <> "Data Adjustment" Then
			
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
			
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Date Received"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = ""&Date_Received
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
		End If

		If JOB = "Pending Recognition" Then	
			
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
			
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "State"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = ""&State
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
		End If

		If JOB = "Data Adjustment" Then	
			
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
			
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Order ID"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = "" & Order_ID
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
		
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "LCIFBatch"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = "" &Batch_ID
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
		
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Type of Adjustment"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = "" &Type_Of_Adjustment
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
		
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Correct Data To"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = "" &Correct_Data_To
			objRecord.appendChild objName
		
			Set objrecord = xmlDoc.createElement("index")  
			objtype.appendchild objRecord
		
			Set objName = xmlDoc.createElement("iname")  
			objName.Text = "Notes"
			objRecord.appendChild objName
		
			Set objName = xmlDoc.createElement("ivalue")  
			objName.Text = "" &Notes
			objRecord.appendChild objName
		End If
		'' -- begin content section here -- ''
		
		Set objcont = xmlDoc.createElement("content")  
		objdoc.appendchild objcont
		
		Set objrecord = xmlDoc.createElement("file")  
		objcont.appendchild objRecord
		
		Set objName = xmlDoc.createElement("fname")
		objName.Text = "" &FILE(q) 
		objRecord.appendChild objName
		
		Set objName = xmlDoc.createElement("format")
		objName.Text = "" & EXT2(q)
		objRecord.appendChild objName

		Set objcont = Nothing
		Set objdoc = Nothing
		Set objtype = Nothing
		
	Next
	
	xmlDoc.Save "C:\Send to Docmall\Upload\LCIF\" & KOID & "\batch.xml"
End Sub

Sub XMLBuilder_ALL_OnUnload

End Sub

  • Like 1
Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.