ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Exporting Excel Schedule to Outlook Calendar Subfolders (https://www.excelbanter.com/excel-programming/333869-exporting-excel-schedule-outlook-calendar-subfolders.html)

littlegreenmen1[_6_]

Exporting Excel Schedule to Outlook Calendar Subfolders
 

I know it is possible to export information from Excel into the Outloo
default calendar. Is it possible to export information to subfolder
under Outlook calendar? If so, how would I go about doing that usin
code from within Excel? Thank you very much

--
littlegreenmen
-----------------------------------------------------------------------
littlegreenmen1's Profile: http://www.excelforum.com/member.php...fo&userid=2397
View this thread: http://www.excelforum.com/showthread.php?threadid=38526


littlegreenmen1[_7_]

Exporting Excel Schedule to Outlook Calendar Subfolders
 

This is my code so far:

Sub Outlook_Calendar_Subfolder()

Dim olApp As Object
Dim olApt As Object
Dim olSubject As Range
Dim olBody As Range
Dim olDate As Range
Dim olLocation As Range

Set olSubject = Sheet1.Cells.Item(1, "A")
Set olBody = Sheet1.Cells.Item(1, "B")
Set olDate = Sheet1.Cells.Item(1, "C")
Set olLocation = Sheet1.Cells.Item(1, "D")
Set olApp = CreateObject("Outlook.Application")
Set olApt = olApp.CreateItem(1)
Set myNameSpace = olApp.GetNameSpace("MAPI")
Set myfolder = myNameSpace.GetDefaultFolder(9)
Set mynewfolder = myfolder.Folders("123 Anywhere St.")

With olApt
..AllDayEvent = True
..Start = olDate
..Subject = olSubject
..Location = olLocation
..Body = olBody
..BusyStatus = 0
..ReminderSet = False
..Save
End With

Set olApp = Nothing
Set olApt = Nothing

End Sub

As of now it still simply copies the information to the default folder.
How do i get it to copy the information into the referenced subfolder?


--
littlegreenmen1
------------------------------------------------------------------------
littlegreenmen1's Profile: http://www.excelforum.com/member.php...o&userid=23978
View this thread: http://www.excelforum.com/showthread...hreadid=385266



All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com