I want to migrate Outlook journal to excel including contact names

Status
Not open for further replies.
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
I would like to know how to migrate Outlook 2010 Journal fields into excel spreadsheet including the contact names.
using the Import/export fucntion, the conatct names, that are linked to the journal note, do not export.
Any special batch file to do?

Thanks for the help

François
 
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
I already did but in my note body there are several lines and the copy paste only gives me the firts line :(
I don't know how macro works though
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I'll see if i have a macro we can use. The other option (if it's a one time thing) is to export and copy - this will get you the full notes field and anything not exported. You'll need a unique field (usually the date/time) you can sort on to match the records.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I tweaked the code at http://www.slipstick.com/developer/code-samples/macro-export-outlook-fields-excel/ to use the journal entries.

Code:
Option Explicit
Sub CopyToExcel()
Dim xlApp As Object
Dim xlWB As Object
Dim xlSheet As Object
Dim rCount As Long
Dim bXStarted As Boolean
Dim enviro As String
Dim strPath As String
Dim currentExplorer As Explorer
Dim Selection As Selection
Dim olItem As Outlook.JournalItem
Dim obj As Object
Dim strColB, strColC, strColD, strColE, strColF, strColG, strColH       As String
               
' Get Excel set up
enviro = CStr(Environ("USERPROFILE"))
'the path of the workbook
strPath = enviro & "\Documents\test.xlsx"
     On Error Resume Next
     Set xlApp = GetObject(, "Excel.Application")
     If Err <> 0 Then
         Application.StatusBar = "Please wait while Excel source is opened ... "
         Set xlApp = CreateObject("Excel.Application")
         bXStarted = True
     End If
     On Error GoTo 0
     'Open the workbook to input the data
     Set xlWB = xlApp.Workbooks.Open(strPath)
     Set xlSheet = xlWB.Sheets("Sheet1")
    ' Process the message record
    
    On Error Resume Next
'Find the next empty line of the worksheet
rCount = xlSheet.Range("B" & xlSheet.Rows.Count).End(-4162).Row
' get the values from outlook
Set currentExplorer = Application.ActiveExplorer
Set Selection = currentExplorer.Selection
  For Each obj In Selection
    Set olItem = obj
   
'collect the fields
' journal
With olItem
    strColB = .Subject
    strColC = .Type
    strColD = .Body
    strColE = .Start
    strColF = .Duration
    strColG = .ContactNames
    strColH = .Categories
End With
'write them in the excel sheet
  xlSheet.Range("B" & rCount) = strColB
  xlSheet.Range("c" & rCount) = strColC
  xlSheet.Range("d" & rCount) = strColD
  xlSheet.Range("e" & rCount) = strColE
  xlSheet.Range("f" & rCount) = strColF
  xlSheet.Range("g" & rCount) = strColG
  xlSheet.Range("h" & rCount) = strColH
 
'Next row
  rCount = rCount + 1
Next
     xlWB.Close 1
     If bXStarted Then
         xlApp.Quit
     End If
    
     Set olItem = Nothing
     Set obj = Nothing
     Set currentExplorer = Nothing
     Set xlApp = Nothing
     Set xlWB = Nothing
     Set xlSheet = Nothing
End Sub
 
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
Good morning Diana, Let me look at this and will get back to you. Thank you very much fo the help!
 
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
Good morning Diane, it works great, thank you very much. There is one thing I did not realize though, some of my customers have the same exact name. Is there a way where I can add the Company name in another column. I used your codes and added lines for the Company and then tried with the spelling CompanyNames but nothing shows up. I'm trying to find out if that field has another name than what I see. Canb you help me out?
Regards,
 
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
here is what I tried but it gives me an error


Sub CopyToExcel()
Dim xlApp As Object
Dim xlWB As Object
Dim xlSheet As Object
Dim rCount As Long
Dim bXStarted As Boolean
Dim enviro As String
Dim strPath As String
Dim currentExplorer As Explorer
Dim Selection As Selection
Dim olItem As Outlook.JournalItem, contactItem
Dim obj As Object
Dim strColB, strColC, strColD, strColE, strColF, strColG, strColH, strColI, strColJ As String

' Get Excel set up
enviro = CStr(Environ("USERPROFILE"))
'the path of the workbook
strPath = enviro & "\Documents\testfp.xlsx"
On Error Resume Next
Set xlApp = GetObject(, "Excel.Application")
If Err <> 0 Then
Application.StatusBar = "Please wait while Excel source is opened ... "
Set xlApp = CreateObject("Excel.Application")
bXStarted = True
End If
On Error GoTo 0
'Open the workbook to input the data
Set xlWB = xlApp.Workbooks.Open(strPath)
Set xlSheet = xlWB.Sheets("Sheet1")
' Process the message record

On Error Resume Next
'Find the next empty line of the worksheet
rCount = xlSheet.Range("B" & xlSheet.Rows.Count).End(-4162).Row
' get the values from outlook
Set currentExplorer = Application.ActiveExplorer
Set Selection = currentExplorer.Selection
For Each obj In Selection
Set olItem = obj

'collect the fields
' journal
With olItem
strColB = .Subject
strColC = .Type
strColD = .Body
strColE = .Start
strColF = .Duration
strColG = .ContactNames
strColH = .Categories

'collect the fields
' contact

strColI = .CompanyNames
strColJ = .BusinessAddressPostalCode

End With
'write them in the excel sheet
xlSheet.Range("B" & rCount) = strColB
xlSheet.Range("c" & rCount) = strColC
xlSheet.Range("d" & rCount) = strColD
xlSheet.Range("e" & rCount) = strColE
xlSheet.Range("f" & rCount) = strColF
xlSheet.Range("g" & rCount) = strColG
xlSheet.Range("h" & rCount) = strColH
xlSheet.Range("i" & rCount) = strColI
xlSheet.Range("j" & rCount) = strColJ

'Next row
rCount = rCount + 1
Next
xlWB.Close 1
If bXStarted Then
xlApp.Quit
End If

Set olItem = Nothing
Set obj = Nothing
Set currentExplorer = Nothing
Set xlApp = Nothing
Set xlWB = Nothing
Set xlSheet = Nothing
End Sub
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
use .companies, not .companynames, to grab the company field.
 
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
Hi,
Thanks for the feedback, I really appreciate your help. I will get back to you shortly
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
D Outlook 2016 Migrate 'On My Computer' (local storage) Calendar from Mac Outlook to Exchange Account Using Outlook 5
B Migrate Outlook 2007 to Office 365 Using Outlook 3
T Migrate POP3 Folders and Emails to outlook.com via Outlook 2013 Using Outlook.com accounts in Outlook 2
J migrate outlook mail folders from user's old workstation to their new pc Using Outlook 6
T Items in MSN Hotmail inbox will not migrate to Outlook inbox Using Outlook 2
R Migrate Mac Outlook 2011 to PC outlook 2010 Using Outlook 2
J Too many email folders on MSN issue. Migrate to Outlook? Using Outlook 3
J Migrate from godaddy 365 to office 365 home Using Outlook 8
P Migrate Office 365 mailbox to a different on-premises domain Using Outlook 1
T OL BCM 2007 - Possible to migrate SQL Server Express 2012 ? BCM (Business Contact Manager) 2
P Migrate profile - cached mode setting Using Outlook 2
S Outlook email to configure setup for each mail Outlook VBA and Custom Forms 0
witzker print-list-of-outlook-folders with sort posibility Outlook VBA and Custom Forms 7
witzker Open Contact missing in Outlook 2019 Using Outlook 2
D.Moore VB script to Digitaly Sign newly created outlook message Outlook VBA and Custom Forms 2
B Outlook 2016 Retail C2R keeps logging since update? Using Outlook 0
M outlook 365 trying to finish my sentences Using Outlook 0
D Outlook Address Book Using Outlook 0
B Emails get stuck in Outbox of Gmail IMAP in Outlook for Windows Using Outlook 0
C Not sync folders not found after MS Outlook 365 update Using Outlook 1
V Outlook 2016 Does Outlook-2016 (64 bit) work with iCloud for Windows ? Using Outlook 4
R Microsoft Outlook 2016 - Gmail not sending, asks for password for SMTP, tried different ports Using Outlook 23
V Outlook 2016 Outlook-2016 and iCloud for Windows - Problems Using Outlook 2
O VBA Outlook Message Attachment - Array Index Out of Bounds Outlook VBA and Custom Forms 0
K Imap PC Outlook + Android phone Using Outlook 1
GregS Outlook 2016 Move Outlook to new computer? Using Outlook 4
I Outlook 2003 shows html code when To: field is empty Using Outlook 7
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 1
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 2
C All Gmails don't show in Outlook 2019 Using Outlook 3
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
U Outlook 2016 Outlook 2016 sender name Using Outlook 1
T Compuserve, Yahoo, Oath2 and Outlook 2013 Using Outlook 4
E Work uses live accounts for emails for all employees. Can we use the outlook calendar to give the employees an universal work schedule calendar? Using Outlook 1
witzker Macro to move @domain.xx of a Spammail to Blacklist in Outlook 2019 Outlook VBA and Custom Forms 7
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
P outlook 2008 search box criteria couldn't be saved Using Outlook 2
pcunite Outlook 2019/O365 Build 13127.20408 errors when using MAPI calls Using Outlook 1
C Outlook with Office365 - search across account, by date rate, in multiple folders - how? Using Outlook 2
D Outlook 2010 Outlook in Windows 10 keeps asking for user name and password repeatedly Using Outlook 14
S Outlook mail adressing stops after first match in GAL Using Outlook 0
A Apply Selected Emails to outlook rules and Run Rules Using Outlook 5
T Changing Sent Items location in Outlook 2019 Using Outlook 0
J How do I disable advertising in Outlook 2019? Using Outlook 13
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
L Unable to Sync Web/Android MS To Do with Windows Outlook Tasks Using Outlook 3
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0

Similar threads

Top