Manage Learn to apply best practices and optimize your operations.

Export contact details to Word

Create a button on the contact form of names.nsf with the following code. It will launch Word/import the names and address of the contacts in your Word doc in less than a second.

You can create a button on the contact form of names.nsf with the following code. It will launch Word and import the names and address of the contacts in your Word document in less than a second. It is much better than pasting the individual fields in.

  
  Sub Click(Source As Button)
 Dim wordobj As Variant
 Dim FirstName As Variant
 Dim LastName As Variant
 Dim OfficeStreetAddress As Variant
 Dim OfficeCity As Variant
 Dim OfficeState As Variant
 Dim OfficeZip As Variant
 Dim OfficeCountry As Variant
 
 Set wordobj = CreateObject("word.basic.8")
 Dim workspace As New NotesUIWorkspace
 Dim uidoc As NotesUIDocument
 Set uidoc = workspace.CurrentDocument
 Cno=uidoc.FieldGetText("CompanyName") 
 FirstName=uidoc.FieldGetText("FirstName") 
 LastName=uidoc.FieldGetText("LastName") 
 OfficeStreetAddress=uidoc.FieldGetText
("OfficeStreetAddress") 
 OfficeCity=uidoc.FieldGetText("OfficeCity") 
 OfficeState=uidoc.FieldGetText("OfficeState") 
 OfficeZip=uidoc.FieldGetText("OfficeZip") 
 OfficeCountry=uidoc.FieldGetText("OfficeCountry") 
 wordobj.filenew  
 wordobj.insert FirstName & " " &  
LastName &Chr(10)
 wordobj.insert Cno & Chr(10)
 wordobj.insert OfficeStreetAddress & Chr(10)
 wordobj.insert OfficeCity & Chr(10)
 wordobj.insert OfficeState & Chr(10)
 wordobj.insert OfficeZip & Chr(10)
 wordobj.insert OfficeCountry & Chr(10)
 wordObj.AppShow
 
End Sub

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member Sarah Hammond. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

This was last published in November 2004

Dig Deeper on LotusScript

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchExchange

SearchContentManagement

Close