Take a Notes View of Documents and Export their Values to a Word Table

Author: Tripp W Black

Created: 11/30/1999 at 07:52 PM

 

Category:
Notes Developer Tips
LotusScript, General

Need:
To pump data from predefined set of documents to MS Word in form of report for this I am using a template which has a tabular format

A Solution:

Set wddoc = object.ActiveDocument
Set range = wddoc.Content
Set table = wddoc.Tables.Add(range,1,7)
Set selection = object.Selection
selection.TypeText("Name")
selection.MoveRight(12)
selection.TypeText("Company")
selection.MoveRight(12)
selection.TypeText("Address")
selection.MoveRight(12)
selection.TypeText("Address2")
selection.MoveRight(12)
selection.TypeText("City")
selection.MoveRight(12)
selection.TypeText("State")
selection.MoveRight(12)
selection.TypeText("Zip")
selection.MoveRight(12)

Set doc = view.GetFirstDocument
While Not doc Is Nothing
selection.TypeText(doc.ContactSalutation(0) & " " & doc.ContactFName(0) & " " & doc.ContactLName(0))
selection.MoveRight(12)
selection.TypeText(doc.AccountName(0))
selection.MoveRight(12)
selection.TypeText(doc.ContactAddress_1(0))
selection.MoveRight(12)
selection.TypeText(doc.ContactAddress_2(0))
selection.MoveRight(12)
selection.TypeText(doc.ContactCity(0))
selection.MoveRight(12)
selection.TypeText(doc.ContactState(0))
selection.MoveRight(12)
selection.TypeText(doc.ContactZip(0))
selection.MoveRight(12)
Set doc = view.GetNextDocument(doc)
Wend

previous page