Mail Merge in WordProcessingML - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Mail Merge in WordProcessingML

Description:

Mail Merge in WordProcessingML. Article by Sheela E.N, Sonata Software Limited. Outline ... A mail merge is a word processing feature that allows in creating ... – PowerPoint PPT presentation

Number of Views:81
Avg rating:3.0/5.0
Slides: 15
Provided by: cseTt
Category:

less

Transcript and Presenter's Notes

Title: Mail Merge in WordProcessingML


1
Mail Merge in WordProcessingML
  • Article by Sheela E.N,
  • Sonata Software Limited

2
Outline
  • Introduction
  • Connecting to an external data source
  • Populating mail merge fields with external data
  • Result

3
Introduction
  • This article briefly explains the concept of Mail
    Merge and how this information is stored in
    WordProcessingML.
  • A mail merge is a word processing feature that
    allows in creating common letters, mailing
    labels, envelopes, or cataloging documents to a
    group of people as stored in a database.

4
Introduction
  • We use mail merge when we want to create a set of
    documents that are essentially in a template
    format but only in a single place contains unique
    information. For example, in a letter that
    announces a new product to all its customers, the
    company logo and the text about the product is
    common and will appear in each letter, while the
    customer address and greeting line will be
    different in each letter.

5
Introduction
  • The two key parts of the mail merge
  • process are
  • 1. Connecting to an external data source
  • 2. Populating mail merge fields with external data

6
external data source
  • The connection details of the external data
    source are mentioned in the settings.xml file as
  • ltwsettings xmlnsr"http//schemas.openxmlformats
    .org/officeDocument/2006/relationships"
    xmlnsw"http//schemas.openxmlformats.org/wordpro
    cessingml/2006/main" xmlnsslhttp//schemas.openx
    mlformats.org/schemaLibrary/2006/main .. ..
    gt
  • ltwmainDocumentType wval"envelopes"/gt
  • ltwlinkToQuery/gt
  • ltwdataType wval"native"/gt
  • ltwquery wval"SELECT FROM test "/gt
  • ltwdataSource rid"rId1"/gt
  • ltwviewMergedData/gt
  • ltwactiveRecord wval"4"/gt
  • ltwodsogt

7
  • ltwudl wval"ProviderMicrosoft.ACE.OLEDB.12.0Us
    er IDAdminData SourceD\....\....\....\MailMerg
    e\MailMerge.mdbModeReadExtended
    PropertiesquotquotJet OLEDBSystem
    databasequotquotJet OLEDBRegistry
    PathquotquotJet OLEDBEngine Type5Jet
    OLEDBDatabase Locking Mode0Jet OLEDBGlobal
    Partial Bulk Ops2Jet OLEDBGlobal Bulk
    Transactions1Jet OLEDBNew Database
    PasswordquotquotJet OLEDBCreate System
    DatabaseFalseJet OLEDBEncrypt
    DatabaseFalseJet OLEDBDon't Copy Locale on
    CompactFalseJet OLEDBCompact Without Replica
    RepairFalseJet OLEDBSFPFalseJet
    OLEDBSupport Complex DataFalse"/gt
  • ltwtable wval"test"/gt
  • ltwsrc rid"rId1"/gt
  • ltwcolDelim wval"9"/gt
  • ltwtype wval"database"/gt
  • ltwfHdr/gt
  • ltwrecipientData rid"rId3"/gt
  • lt/wodsogt
  • lt/wmailMergegt
  • .

8
ltwmailMergegt
  • The ltwmailMergegt element specifies the
    following information of the hosting application
    to connect to an external data source
  • 1. wmainDocumentType specifies the type of
    the mail merge. The possible types are
  • a. formLetters.
  • b. email
  • c. envelopes
  • d. fax
  • e. mailingLabels
  • f. catalog
  • 2. wquery specifies the table to be queried
  • 3. wdataSource specifies the link to the
    external data source. The details are stored in
    document setting part relationship.
  • 4. wviewMergedData specifies that the
    merged document shall display the data from the
    specified external data source where merge fields
    have been inserted.
  • 5. wactiveRecord specifies which record
    within the data source should be displayed.
  • 6. wodso The Office Data Source Object
    (odso) settings is optional details which
    specifies a group of additional settings for the
    mail merge information which comprises an
    extension to the standard settings stored with a
    mail merge.

9
recipient data part
  • ltwrecipients xmlnsr"http//schemas.openxmlform
    ats.org/officeDocument/2006/relationships"
    xmlnswp"http//schemas.openxmlformats.org/drawin
    gml/2006/wordprocessingDrawing"
    xmlnsw"http//schemas.openxmlformats.org/wordpro
    cessingml/2006/main" . . gt
  • ltwrecipientDatagt
  • ltwactive wval"0"/gt
  • ltwcolumn wval"2"/gt
  • ltwuniqueTag wval"MQ"/gt
  • lt/wrecipientDatagt
  • ltwrecipientDatagt
  • ltwactive wval"0"/gt
  • ltwcolumn wval"2"/gt
  • ltwuniqueTag wval"Mq"/gt
  • lt/wrecipientDatagt
  • .
  • .
  • lt/wrecipientsgt

10
recipient data part
  • The ltwrecipientDatagt element specifies the
    following details for the inclusion/exclusion of
    records within mail merged document.
  • 1. wcolumn specifies the column on which
    the filter has applied based on the value of the
    column (like where clause on that column)
  • 2. wuniqueTag specifies the contents of a
    given record within the specified external data
    source, in the column containing unique data for
    every record within the external data source for
    inclusion/exclusion of records for mail merge.
    The value specifies that this should be the
    base64-encoded value of the unique tag value as
    specified by the data source. This element is
    used along with ltwcolumngt element.
  • 3. wactive specifies whether the record to
    be shown on not. The default value is 1 which
    indicates the record is included for the mail
    merge
  • If this part is not present, it indicates that
    all the records within the data source are
    included for the mail merge.

11
main document part
  • In the main document part (document.xml by
    default), the merge fields are populated by
    extracting data from external data source and the
    same is represented as
  • ltwbodygt
  • .
  • .
  • ltwfldSimple winstr"MERGEFIELD FirstName"gt
  • ltwrgt
  • ltwrPrgt
  • ltwnoProof /gt
  • lt/wrPrgt
  • ltwtgtFirstNamelt/wtgt
  • lt/wrgt
  • lt/wfldSimplegt
  • lt/wbodygt
  • In the above XML snippet, the merge field
    FirstName is inserted in a WordprocessingML
    document which connects to the external data
    source. When the mail merge takes place, the data
    from the FirstName column will be populated into
    the field FirstName (ltwfldSimple
    winstr"MERGEFIELD FirstName"gt) within the
    merged WordprocessingML document.

12
Result
  • The word document containing mail merge field
    place holders is illustrated as

13
Result
  • When the mail merge takes place, the data will be
    generated and displayed as

14
Result
  • When the mail merge takes place, the data will be
    generated and displayed as
Write a Comment
User Comments (0)
About PowerShow.com