如何在Excel中使用VBA代表另一个日历发送会议请求? [英] How can I use VBA in Excel to send out meeting requests on behalf of another calendar?

查看:1354
本文介绍了如何在Excel中使用VBA代表另一个日历发送会议请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第二次发布此请求,因为虽然我已经从JimmyPena的答复,解决方案没有工作,我似乎不能添加我的意见,关于发生了什么。 VBA代码在Excel电子表格而不是Outlook。

I am posting this request a second time , since although I have had a reply from JimmyPena, the solution didn't work and I do not seem to be able to add my comments as to what happened. The VBA code is in the Excel spreadsheet not Outlook.

我想在Excel 2007中编写一些VB代码,将自动从Outlook 2007日历发送会议邀请,到excel电子表格中列出的收件人列表中,在电子表格中指定的日期。这是有用的,因为我可以发送数百个会议请求到不同的人在不同的日期,只需点击一个按钮。从我自己的用户帐户发送以下代码时,我可以这样做:

I am trying to write some VB code within Excel 2007 that will automatically send out meeting invites from the Outlook 2007 Calendar, to a list of addressees listed in the excel spreadsheet, on the dates specified within the spreadsheet. This is useful because I can send out hundreds of meeting requests to different people on different dates with one click of a button. I can do this fine when sending from my own user account with the following code:

' Create the Outlook session 
Set myoutlook = CreateObject("Outlook.Application") 
' Create the AppointmentItem 
Set myapt = myoutlook.CreateItem(olAppointmentItem)     ' Set the appointment properties 
With myapt 
    .Subject = " Assessment Centre " 
    .Location = "conference room A" 
    .Start = Cells(5, 24 + j) & " 17:00:00 PM" 
    .Duration = 120 
    .Recipients.Add Cells(i, 1).Value 
    .MeetingStatus = olMeeting 
    ' not necessary if recipients are email addresses 
    'myapt.Recipients.ResolveAll 
    .AllDayEvent = "False" 
    .BusyStatus = "2" 
    .ReminderSet = False 
    .Body = L1 & vbCrLf & vbCrLf & L2 & vbCrLf & vbCrLf & L3 & vbCrLf & vbCrLf & L4 
        .Save 
    .send 
End With 

我想从一个虚拟用户帐户发送会议请求,我使用类似'sendonbehalfof'的代理,以便虚拟日历存储所有会议邀请,并且其他代理可以使用相同的虚拟用户帐户操作系统。发送包含以下代码的电子邮件时,此工作正常:

But now I want to send the meeting request from a dummy user account for which I am a delegate using something like ’sendonbehalfof’ so that the dummy calendar stores all the meeting invites, and other delegates can operate the system as well using the same dummy user account. This works fine when sending an email with the following code:

Set oApp = CreateObject("Outlook.Application") 
Set oMail = oApp.CreateItem(0) 

With oMail 
    .To = " John.Smith@John_Smith.com " 
    .Subject = "Subject" 
    .Body = "Body" 
    .SentOnBehalfOfName = "Fred.bloggs@fred_blogs.com" 
    .send 
End With 

电子邮件将从'my代表Fred Bloggs'

The email will say from ’me on behalf of Fred Bloggs’

但我不能让它工作

我已经用预约,会议请求,sendonbehalfof等字样搜索了高和低,似乎你应该能够这样做与sendusingaccount的约会,但这似乎不工作(它不会失败,只是忽略指令,并从我自己的用户帐户发送,像以前一样)。

任何人都可以告诉我如何去做这个?
。非常感谢。

I’ve searched high and low with words like ‘appointment’, ‘meeting request’, sendonbehalfof’ etc, and it seems you should be able to do this for appointments with ’sendusingaccount’ but this doesn’t seem to work (it doesn’t fail, just ignores the instruction and sends from my own user account as before).
Can anyone tell me how to do this? . Thanks very much.

推荐答案

您是否考虑过生成Internet日历约会(ICA)请求并通过电子邮件发送?我相信该格式包含您可以使用的委托信息。

Have you considered generating an Internet Calendar Appointment (ICA) request and emailing it? I believe that format contains delegate information that you can use.

这是一个链接一些Microsoft文档如何添加这个(在ASP.Net,但这不应该)和< a href =http://www.ietf.org/rfc/rfc2445.txt =nofollow>这里是链接到定义格式的IETF RFC。

Here is a link to some Microsoft documentation on how to add this (in ASP.Net, but that shouldn't matter) and here is a link to the IETF RFC that defines the format.

这篇关于如何在Excel中使用VBA代表另一个日历发送会议请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆