Using Powershell to generate Word document containing labels from CSV


In some situations you may have a CSV file containing names and addresses and you wish to print labels on standard Avery 5160 paper. You can manually do a mail merge in Word as outlined here or here. However, if you’re trying to automate the process for a recurring scenario, or in an application, or for a large number of CSV files, this script comes in handy.

This script requires MS Word 2003 or above installed on the computer where it is run. csv2Its input is a comma delimited CSV file containing the following headings:

‘First Name’,’Last Name’,’AddressNo’,’Address’,’City’,’State’,’Zip’

Its output is a Word document containing labels ready to print on standard Avery 5160 labels

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s