msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Macro to add date automatically to MEETING INVITE

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook
Author Message
nemadrias



Joined: 11 Feb 2008
Posts: 1

PostPosted: Mon Feb 11, 2008 5:27 pm    Post subject: Macro to add date automatically to MEETING INVITE Reply with quote

Hi -
Can someone explain why this code doesn't work possibly?

Sub AddDate()
Dim msg As Outlook.MeetingItem
Dim str As String
str = CStr(Now())
msg.Body = str & vbCrLf
msg.Display
Set msg = Nothing
End Sub

I assigned it to a toolbar button, and want to be able to
automatically add the current date to the body of the meeting
invite...any ideas please? I can do it with a new mail message
easily, but for some reason not with a meeting invite. Thanks,
Steve

Archived from group: microsoft>public>office>developer>outlook>vba
Back to top
View user's profile Send private message
Ken Slovak - [MVP - Outlo



Joined: 12 Aug 2007
Posts: 405

PostPosted: Mon Feb 11, 2008 9:24 pm    Post subject: Re: Macro to add date automatically to MEETING INVITE Reply with quote

Well for one thing msg isn't assigned to anything so you're trying to add to
the Body of a null object.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"nemadrias" wrote in message @v67g2000hse.googlegroups.com...
> Hi -
> Can someone explain why this code doesn't work possibly?
>
> Sub AddDate()
> Dim msg As Outlook.MeetingItem
> Dim str As String
> str = CStr(Now())
> msg.Body = str & vbCrLf
> msg.Display
> Set msg = Nothing
> End Sub
>
> I assigned it to a toolbar button, and want to be able to
> automatically add the current date to the body of the meeting
> invite...any ideas please? I can do it with a new mail message
> easily, but for some reason not with a meeting invite. Thanks,
> Steve

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group