VB - 将Outlook日历导出到Excel,包括“会议组织者”

时间:2015-02-06 13:34:39

标签: vb.net outlook export-to-excel

我有一长串代码可以将信息从Outlook日历提取到Excel文件,而用户只需选择一个日期范围,但是对于一个用户来说是有用的,如果有的话多个用户然后我需要提取“MeetingOrganizer”,因为它在使用“导入/导出”向导将其提取到CSV文件时被调用,但是我无法解决我需要添加的内容,这里是相关的位我需要添加它的代码,感谢您给我的任何帮助:

'Write Excel Column Headers
            With excWks
                .Cells(1, 1) = "Subject"
                .Cells(1, 2) = "Location"
                .Cells(1, 3) = "MeetingOrganizer" 'Does not work
                .Cells(1, 4) = "StartDate"
                .Cells(1, 5) = "FinishDate"
                .Cells(1, 6) = "StartTime"
                .Cells(1, 7) = "FinishTime"
                .Cells(1, 8) = "Hours"
            End With



> xcWks.Cells(lngRow, 1) = olkApt.Subject
>                     excWks.Cells(lngRow, 2) = olkApt.Location
>                     excWks.Cells(lngRow, 3) = olkApt.MeetingOrganizer 'Does not work
>                     excWks.Cells(lngRow, 4) = Format(olkApt.Start, "mm/dd/yyyy")
>                     excWks.Cells(lngRow, 5) = Format(olkApt.End, "mm/dd/yyyy")
>                     excWks.Cells(lngRow, 6) = Format(olkApt.Start, "hh:nn ampm")
>                     excWks.Cells(lngRow, 7) = Format(olkApt.End, "hh:nn ampm")
>                     excWks.Cells(lngRow, 8) = DateDiff("n", olkApt.Start, olkApt.End) / 60
>                     excWks.Cells(lngRow, 8).NumberFormat = "0.00"

我追求的主要是给会议组织者的具体名称。所以你可以看到位置和主题是两个明显的例子,无论我尝试什么,我似乎都没有在哪里,希望有人会已经解决了这个......

感谢您的帮助

1 个答案:

答案 0 :(得分:0)

得到了它:

    .Cells(1, 4) = "User"

    excWks.Cells(lngRow, 4) = strLst