please customize this code

Status
Not open for further replies.

montu

Member
Outlook version
Outlook 2010 64 bit
Email Account
IMAP
Hi,

I am going to share my code here in which i need your help to achieve my goal. Here is my code and please see below, where dotted line are, here i want to export each item into excel sheet that we launched through code. please help me.
Dim objOL As Outlook.Application
Dim objNS As Outlook.namespace
Dim objExpCal As Outlook.Explorer
Dim objNavMod As Outlook.CalendarModule
Dim objNavGroup As Outlook.NavigationGroup
Dim objNavFolder As Outlook.NavigationFolder
Dim objFolder As Outlook.Folder

Dim oItems As Outlook.Items

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
strSheet = "OutlookItems.xls"
strPath = "C:\Examples\"
strSheet = strPath & strSheet
Debug.Print strSheet
Set appExcel = CreateObject("Excel.Application")
appExcel.Workbooks.Open (strSheet)
Set wkb = appExcel.ActiveWorkbook
Set wks = wkb.Sheets(1)
wks.Activate
appExcel.Application.Visible = True

Set objOL = Application
Set objNS = objOL.Session
Set colExpl = objOL.Explorers
Set objExpCal = _
objNS.GetDefaultFolder(olFolderCalendar).GetExplorer
Set objNavMod = objExpCal.NavigationPane.Modules. _
GetNavigationModule(olModuleCalendar)
Set objNavGroup = objNavMod.NavigationGroups. _
GetDefaultNavigationGroup(olPeopleFoldersGroup)
For Each objNavFolder In objNavGroup.NavigationFolders
Set objFolder = objNavFolder.Folder
Set oItems = objFolder.Items
Debug.Print (oItems.Count)

For Each MyItem In oItems

--------------:confused:Here i want to export each item into excel sheet that we launched:confused:

--------------Next

Set objExpl = _
colExpl.Add(objFolder, olFolderDisplayNormal)
Next

End Sub
 
Status
Not open for further replies.
Top