Excel Hotmail



How To Do a Mail Merge in Word Using an Excel Spreadsheet
1562

The Excel spreadsheet app lets you create, view, edit, and share your files with others quickly and easily. Sheets can easily be checked, edited and shared on the go. Excel makes it easy to review and analyze data, budgets more while you view and edit workbooks attached to email messages. Create a new spreadsheet and edit it with others at the same time — from your computer, phone or tablet. Free with a Google account.

Performing a Mail Merge is a great way to generate personalized letters or emails.

  • Get free Outlook email and calendar, plus Office Online apps like Word, Excel and PowerPoint. Sign in to access your Outlook, Hotmail or Live email account.
  • Need help installing Office? See all Office options.
  • Open the email in your email client (either new or reply) and press the Attach button. Now that the Insert File window is open, you just need paste (Ctrl+V) the full file path in the File Name box and press Enter. That might seem like a lot of steps, but it is actually pretty fast once you practice it a few times.

There are three documents involved in the mail merge process:

  • Your main document
  • Your data source
  • Your merged document

NOTE: The examples shown below contain sample screen shots from Microsoft Word 2016. If you have a different version of Word, there may be some slight differences however, the same basic program flow should apply.

Step 1: Create your Excel Spreadsheet

The most important step in the mail merge process is to set up and prepare your data. You’ll use your Excel spreadsheet as the data source for your recipient list.

Here are some tips to prepare your data for a mail merge:

  • Make sure the column names on your spreadsheet match the field names you want to insert in your mail merge
  • All data to be merged is present in the first sheet of your spreadsheet
  • All data entries with percentages, currencies, and zip codes are correctly formatted in the spreadsheet so that Word can properly read their values
  • The Excel spreadsheet to be used in the mail merge is stored on your local computer
  • Changes or additions to your spreadsheet are completed before it’s connected to your mail merge document in Word
Pelo

Step 2: Create a mail merge document

When creating a mail merge you have the ability to use an existing document/letter.

In Word, open the existing file and press the ‘Mailings’ tab in the main menu.

On the Mailings tab, choose the ‘Start Mail Merge’ button, a list of different types of documents will drop down (i.e. Letters, E-mail Messages, etc.). choose the kind of merge you want to run.

Now choose the ‘Select Recipients’ button and choose ‘Use an Existing List’

Excel

Browse to find your Excel spreadsheet you previously saved, and then choose ‘OK’.

NOTE: Now the Excel spreadsheet is connected to the mail merge document you’re creating in Word.

Step 3: Inserting the merge fields

You will notice menu items are now active that were not previously

You can insert one or more mail merge fields that pull the information from your spreadsheet into your document.

On your Word document, highlight the field you want to populate with the data from Excel.

On the Mailings tab, choose the ‘Insert Merge Field’ button, a list of the column headers on your saved excel document will drop down (i.e. Company Name, etc.). Choose the appropriate field you want to merge and choose Insert.

The highlighted field will be replaced with the merge field (i.e. «Company», etc.)

Repeat step 3 for each of the fields you want to merge and choose Close when done.

Now choose ‘Save’.

Step 4: Previewing the mail merge

After you insert the merge fields you want you can now preview the results to confirm that the document is set-up the way you want.

On the Mailings tab, choose ‘Preview Results’. The merge fields will be populated with the data on the first row of your excel document.

To move through the records in your data source and view how they will appear in the document choose the right arrow to advance or the left arrow for the previous record.

Step 5: Merging and Saving your mail merge

On the Mailings tab, choose the ‘Finish & Merge’ button, a list of different types of merges will drop down (i.e. Edit Individual Documents, Print Documents and Send Email Messages) choose ‘Edit Individual Documents’. A ‘Merge to New Document’ pop-up box will appear, choose ‘OK’.

You will now have a separate letter for each of the rows on the excel document which you can print, email, etc.

Step 6: Saving your mail merge document

When you are done working with your merged documents, save and close it as you would any other Word document. Once closed the mail merge template will still be open. If you plan to reuse it in the future, save it and it will stay connected to your data source.

NOTE: A mail merge can just as easily be an email merge. Add a column to your excel spreadsheet that contains the email address to send each merged letter to. Under 'Finish and Merge', select 'Send Email Messages' and for the TO specify the column name that contains the email address and specify the SUBJECT to use.

-->

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release. Civilization 4 1.0.

Summary: Microsoft Excel MVP Ron de Bruin provides several samples and a useful add-in that makes it easy for customers to send items from Excel with Outlook. From sending a workbook to sending items to multiple recipients, the code samples and add-in should become a part of your reference library. (8 printed pages)

Applies to: Microsoft Excel 2000 | Microsoft Excel 2002 | Microsoft Excel 2003 | Microsoft Excel 2007 | Microsoft Excel 2010 | Microsoft Outlook 2000 | Microsoft Outlook 2002 | Microsoft Outlook 2003 | Microsoft Outlook 2007 | Microsoft Outlook 2010
Provided by:Ron de Bruin, Microsoft Excel MVP | Frank Rice, Microsoft Corporation | About the Authors

Contents

  • Sending Outlook E-mail Messages from Excel

  • Mailing Workbooks as E-mail Attachments

  • Mailing Single Sheets as Attachments

  • Conclusion

Read Part Two: OfficeTalk: Using the Excel Object Model to Send Workbooks and Ranges through E-Mail with Outlook (Part 2 of 2)

Sending Outlook E-mail Messages from Excel

This article features code samples that you can use to perform various e-mail functions from Microsoft Office Excel by using the Microsoft Office Outlook object model. Ron de Bruin, an Excel Most Valuable Professional (MVP) and a frequent contributor to the newsgroups, provides the samples and add-in. You can find many more samples and an excellent add-in (RDBMail Add-in) that gives you several e-mail options on the Ribbon user interface (UI), at Ron’s Web site.

Sending workbooks and workbook components from Excel with Outlook is a frequently requested activity. It is relatively easy to do much of this by using commands on the Ribbon UI. However, you may want more control over what you can send. Doing this by using Microsoft Visual Basic for Applications (VBA) in Excel is where developers can make the biggest impact.

One method to use is the SendMail method in the Excel object model. This method works very well but is limited in what it can do. You can find examples using the SendMail method and a link to download a useful add-in created by Ron de Bruin in the article titled Working with Excel Workbooks and Worksheets in E-Mail.

Note

The code samples that are presented in this article will only work with Microsoft Outlook. They will not work with Microsoft Outlook Express or Microsoft Windows Mail.

You need to be aware of two security features for Outlook 2002, Outlook 2003, Outlook 2007, and Outlook 2010. Note that these features are implemented through a security update in Outlook 2000:

  • Blocking of a customizable list of file attachments considered unsafe because they can be used to propagate viruses.

  • Pop-up confirmation dialog boxes that occur when a program accesses address-related properties or attempts to send a message.

For more information about Outlook 2007 and Outlook 2010, see the article titled Code Security Changes in Outlook 2007.

In the following sections, I describe some of the VBA code samples created by Ron de Bruin.

Mailing Workbooks as E-mail Attachments

The following subroutine sends the last saved version of the active workbook in an e-mail message. Change the mail address and subject in the macro before you run the procedure.

The following subroutine sends a newly created workbook as a copy of the ActiveWorkbook object. Before sending the workbook, it is saved with a date-time stamp. After the file is sent, the workbook is deleted from the hard disk drive.

Excel hotmail

Tip

In the previous example, the file wb2 is opened by using the Workbooks.Open method and then mailed, closed, and finally deleted. It is also possible to perform these operations on the file without first opening it. However, by opening the file, you can add code to perform other operations such as the following statement which inserts text and a date into cell A1. You can also perform other operations such as deleting a worksheet or range in the workbook before sending it.

Sign In

wb2.Worksheets(1).Range('A1').Value = 'Copy created on ' & Format(Date, 'dd-mmm-yyyy')

wb2.Save

Early Binding

If you want to use IntelliSense help show you the properties and methods of objects as you type them into the VBA Code Editor, you can use early binding. For more information about early binding, see the Word MVP site.

To add early binding, follow these steps:

  1. First, add a reference to the Outlook Object Library. Open the VBA editor by typing Alt +F11.

  2. On the Tools menu, click References.

  3. Select Outlook xx Object Library where xx is the version number such as the Microsoft Outlook 12.0 Object Library.

  4. Next, replace the following three statements in the code:

    With these three statements.

Mailing Single Sheets as Attachments

The following subroutine sends a newly created workbook with just a single sheet as the ActiveSheet object. The procedure saves the workbook before mailing with a date-time stamp. After the file is sent, the workbook is deleted from the hard disk. Change the mail address and subject in the macro before you run the procedure.

Note

For additional information about how to work with different versions of Excel, see the section following this code block.

Note

You can also use the following statement if you know the sheet you want to mail. It does not have to be the active sheet. Sheets('Sheet5').Copy

Additional Information

In the macro, you see that if Val(Application.Version) < 12 is true, the next statement is as follows: FileExtStr = '.xls': FileFormatNum = -4143. This value represents the workbook format for Excel versions 97 through 2003.

However, if you run the code in Excel 2007 or Excel 2010, the code will look at the file format of the parent workbook and save the new file in that format.

If the parent workbook is a macro-enabled file (.xlsm) and there is no code in the new workbook, the new file will be saved as a macro-free file (. xlsx). This way, the e-mail recipient can recognize that this is a macro-free file. If the parent workbook is not an .xlsx, .xlsm, or .xls file, the new workbook will be saved as an Excel binary file (.xlsb).

The following are the main formats in Excel 2007 and Excel 2010:

  • 51 = xlOpenXMLWorkbook (macro-free file . xlsx)

  • 52 = xlOpenXMLWorkbookMacroEnabled (macro-enabled file . xlsm)

  • 50 = xlExcel12 (Excel binary workbook with or without macros .xlsb)

  • 56 = xlExcel8 (Excel version 97 through 2003 format file .xls)

If you always want to save in a specific format, you can replace the following statements in the macro.

With one of these statements.

In addition to saving the workbook in an Excel file format, you can also save the single-sheet workbook to one of the following formats:

  • Comma separated value file (.csv)

  • Text file (.txt)

  • Printable file (.prn.)

You should use one of the following statements, respectively.

If you want to use IntelliSense help show you the properties and methods of objects as you type them into the VBA Code Editor, you can use early binding. See the previous section for more information about early binding.

Hotmail Inbox

To use early binding in this procedure, replace these three statements in the code.

With these three statements.

Planilha Excel Hotmail

Conclusion

In the second part of this article, you will see the procedures for additional ways to send mail from Excel to Outlook. To continue, read OfficeTalk: Using the Excel Object Model to Send Workbooks and Ranges through E-Mail with Outlook (Part 2 of 2)

About the Authors

Hotmail Excel Online

Ron de Bruin is an Excel Most Valuable Professional (MVP) and a frequent contributor to the newsgroups. For more information, see Ron's Excel page.

Frank Rice is a senior programming writer and frequent contributor to the Microsoft Office Developer Center.