ĭim sServer,oDoc,oRS,sTemp,sHead,oRange,oField Save the file to the WordMailMerge virtual directory. Use Notepad to create a file called Default.asp that contains the code given below. On your Web server, create a virtual directory that is called WordMailMerge. However, similar code may be used to perform a mail merge with any database to which you can make an ADO connection. See the "References" section of this article for links to additional resources on using ADO with XML.įor illustration purposes, the following sample uses the sample Pubs database in Microsoft SQL Server. In turn, clients can use ADO to read the XML recordset and manipulate the data as needed. Using ASP on a Web server, you can build an ADO recordset from a database and return the data as XML to your clients. More InformationĪctiveX Data Objects (ADO) 2.5 and later allows recordset data to be persisted in XML format. Client-side script converts this XML data to a delimited text file that is local to the client and then automates Word to perform a mail merge by using the local text file as the mail merge data source. The sample illustrates Active Server Pages (ASP) code that streams an XML recordset from a Web server to a client. Word does not have a direct method for using XML data as the data source for a mail merge. This article demonstrates how to automate Microsoft Word from client-side script to perform a mail merge for labels.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |