Outlook doesn’t permit users to export a single contact as a Word document, not to mention exporting multiple contacts as individual Word documents. Therefore, this article will share you a method to achieve that.
Many users would like to export multiple contacts as separate Word documents in bulk. But, there isn’t a direct feature supporting this. Thus, in the followings, we will introduce a smart way, which is using VBA code. Now, read on to learn the detailed steps and elaborate VBA code.
Batch Export Multiple Contacts as Word Bocuments
- For a start, launch your Outlook application.
- Then, in the main Outlook window, press “Alt + F11” keys.
- Next, you’ll get access to the VBA editor window.
- Now, you should firstly enable “Microsoft Word Object Library”, which can be finished by hitting “Tools” > “References”.
- Then, you ought to open an unused module.
- Subsequently, copy the following VBA code into this module.
Sub BatchExportMultipleContactsIntoWordDocuments() Dim objSelectedContacts As Outlook.Selection Dim objContact As Outlook.ContactItem Dim strLocalFolder As String Dim strFileName As String Dim objAttachment As Outlook.Attachment Dim strPhoto As String Dim objWordApp As Word.Application Dim objWordDocument As Word.Document Dim objWordRange As Word.Range Dim objInlineShape As Word.InlineShape Set objSelectedContacts = Outlook.Application.ActiveExplorer.Selection If Not (objSelectedContacts Is Nothing) Then Set objWordApp = CreateObject("Word.Application") 'Change the path for saving the word documents strLocalFolder = "E:\" On Error Resume Next For Each objContact In objSelectedContacts 'Export as word document strFileName = strLocalFolder & objContact.FullName & ".doc" objContact.SaveAs strFileName, olDoc 'Insert the contact photo to this document If objContact.Attachments.count > 0 Then For Each objAttachment In objContact.Attachments If InStr(LCase(objAttachment.filename), "contactpicture.jpg") > 0 Then strPhoto = "E:\" & objContact.FullName & ".jpg" objAttachment.SaveAsFile (strPhoto) Set objWordDocument = objWordApp.Documents.Open(strFileName) objWordApp.Visible = True objWordDocument.Activate Set objWordRange = objWordDocument.Range(0, 0) objWordRange.InlineShapes.AddPicture filename:=strPhoto, LinkToFile:=False, SaveWithDocument:=True For Each objInlineShape In objWordDocument.InlineShapes objInlineShape.ScaleHeight = 30 objInlineShape.ScaleWidth = 30 Next objWordDocument.Close True objWordApp.Quit Kill strPhoto End If Next End If Next End If End Sub
- After that, you can exit the current “Microsoft Visual Basic for Applications” window.
- Later, for the convenience, you had better go to “Outlook Options” > “Quick Access Toolbar” to add the new macro to Quick Access Toolbar.
- Finally, you can take a shot:
- First off, select multiple contacts which you want to export.
- Then, hit the macro button in Quick Access Toolbar.
- After the macro completes, you will get multiple Word documents in the predefined local folder, which are corresponding to the selected contacts.
- These Word documents will look like the following screenshot:
What to Do If ScanPST Fails
Outlook comes preinstalled with an inbuilt repair tool – Scanpst. But you cannot pay too much hope to this tool in that it can’t come into effect if the Outlook file is seriously damaged. Therefore, you’re better off keeping a more potent repair tool, such as DataNumen Outlook Repair, in vicinity. It can repair PST file without any fuss.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including corrupt sql and outlook repair software products. For more information visit www.datanumen.com