In Outlook, when you need to extract and copy all tables from one email to another, it’s undoubtedly tedious and cumbersome to do it manually. This article will share a much smarter way with you.
At times, you may desire to create a new email containing the tables of another email. If there is only one table in the email, it is very easy. However, if there are multiple tables in the source email, manually copying is too tedious. So, in the followings, we’ll introduce another way that is far more effective and intelligent.
Copy All Tables from One Email to Another
- For a start, you should access your Outlook as normal.
- Then, in the main Outlook window, you could press “Alt + F11” shortcut keys.
- Subsequently, in the popup “Microsoft Visual Basic for Applications” window, you need to open an unused module or simply insert a new one.
- Next, you could copy the following VBA code into this module.
Sub CopyAllTablesFromOneEmailToAnother() Dim objSourceMail As Outlook.MailItem Dim objSourceMailDocument As Word.Document Dim objNewMail As Outlook.MailItem Dim objNewMailDocument As Word.Document Dim objTable As Word.Table 'Get the source email Select Case TypeName(Application.ActiveWindow) Case "Explorer" Set objSourceMail = ActiveExplorer.Selection.Item(1) objSourceMail.Display Case "Inspector" Set objSourceMail = ActiveInspector.CurrentItem End Select Set objSourceMailDocument = objSourceMail.GetInspector.WordEditor If objSourceMailDocument.Tables.count > 0 Then 'Create a new email Set objNewMail = Application.CreateItem(olMailItem) For Each objTable In objSourceMailDocument.Tables Set objNewMailDocument = objNewMail.GetInspector.WordEditor 'Copy all tables from source email to the new email With objNewMailDocument.Range .Collapse wdCollapseEnd .FormattedText = objTable.Range.FormattedText .Collapse wdCollapseEnd .Text = vbCrLf End With Next 'Close the source email objSourceMail.Close olSave 'Display the new email objNewMail.Display End If End Sub
- After that, you can exit the current VBA editor window.
- Later you ought to change your Outlook macro settings to enable all macros.
- Also, you are better off adding this macro to Quick Access Toolbar, which can be accomplished in “Outlook Options”.
- Finally you can have a try:
- At the very outset, open or select an email whose tables to be copied.
- Then, hit the newly added macro button in Quick Access Toolbar.
- After the macro finishes running, a new email will show up, in which the tables of source email have been pasted.
Defend Outlook File against Corruption
Although Outlook can play a good role no matter as a standalone email client or a private schedule manager, it still cannot be immune from errors and corruptions. Therefore, it is undoubtedly an arduous and tedious task to protect your Outlook data. You have to keep tabs on your daily behaviors in Outlook, such as don’t click suspicious links, download unsafe attachments or close Outlook improperly and so on. Of course, it is necessary for you to keep a stellar repair tool nearby, such as DataNumen Outlook Repair in that it can repair Outlook troubles like a breeze.
Author Introduction:
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including mdf repair and outlook repair software products. For more information visit www.datanumen.com
Leave a Reply