Hi,
I want to automate my outlook 2010. I want to pick specfic calendar folder from outlook and want to export all the contents to some excel file.
Here is I am going to share my half self written code that will open a dialog box to choose a specific folder.
Sub ExportToExcel()
On Error GoTo ErrHandler
Dim appExcel As Excel.Application
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range
Dim strSheet As String
Dim strPath As String
Dim intRowCounter As Integer
Dim intColumnCounter As Integer
Dim msg As Outlook.MailItem
Dim nms As Outlook.namespace
Dim fld As Outlook.MAPIFolder
Dim itm As Object
strSheet = "OutlookItems.xls"
strPath = "C:\Examples\"
strSheet = strPath & strSheet
Debug.Print strSheet
'Select export folder
Set nms = Application.GetNamespace("MAPI")
Set fld = nms.PickFolder
?(What will be the code here?)
?
?
?
?
?
?
End Sub
Please, let me know further idea to fixed it.
Advance Thanks,
I want to automate my outlook 2010. I want to pick specfic calendar folder from outlook and want to export all the contents to some excel file.
Here is I am going to share my half self written code that will open a dialog box to choose a specific folder.
Sub ExportToExcel()
On Error GoTo ErrHandler
Dim appExcel As Excel.Application
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range
Dim strSheet As String
Dim strPath As String
Dim intRowCounter As Integer
Dim intColumnCounter As Integer
Dim msg As Outlook.MailItem
Dim nms As Outlook.namespace
Dim fld As Outlook.MAPIFolder
Dim itm As Object
strSheet = "OutlookItems.xls"
strPath = "C:\Examples\"
strSheet = strPath & strSheet
Debug.Print strSheet
'Select export folder
Set nms = Application.GetNamespace("MAPI")
Set fld = nms.PickFolder
?(What will be the code here?)
?
?
?
?
?
?
End Sub
Please, let me know further idea to fixed it.
Advance Thanks,