E
emferrari
Hi all
I've developed the following macro in order to create a Outlook
appointment from Word:
Sub CreateMeetingRequest()
Dim oApp As Outlook.Application
Set oApp = New Outlook.Application
Dim oNS As Outlook.NameSpace
Set oNS = oApp.Session
'*** Create an AppointmentItem.
Dim oAppt As Outlook.AppointmentItem
Set oAppt =
oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)
'*** Change AppointmentItem to a Meeting.
oAppt.MeetingStatus = Outlook.OlMeetingStatus.olMeeting
'*** Go to the subject bookmark
Selection.GoTo What:=wdGoToBookmark, Name:="subject"
Selection.SelectCell
'*** Set the subject of the meeting
oAppt.Subject = Selection.Text
'*** Select the agenda grid
Selection.GoTo What:=wdGoToBookmark, Name:="agenda"
Selection.Tables(1).Select
oAppt.Body =
Here we go. Two questions.
1º) When I do the Selection.SelectCell it selects the text that has
inside the cell, plus two strange characters (two squares). How do I
remove those characters before setting the properties.
2º) When I select the agenda grid I want to be able to set it in the
Body of the meeting request. I know I can do this using CTRL + C in
word and pasting into the body of the meeting request, but how do I do
this programatically ?
Thanks in advance!
Eduardo Ferrari
I've developed the following macro in order to create a Outlook
appointment from Word:
Sub CreateMeetingRequest()
Dim oApp As Outlook.Application
Set oApp = New Outlook.Application
Dim oNS As Outlook.NameSpace
Set oNS = oApp.Session
'*** Create an AppointmentItem.
Dim oAppt As Outlook.AppointmentItem
Set oAppt =
oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)
'*** Change AppointmentItem to a Meeting.
oAppt.MeetingStatus = Outlook.OlMeetingStatus.olMeeting
'*** Go to the subject bookmark
Selection.GoTo What:=wdGoToBookmark, Name:="subject"
Selection.SelectCell
'*** Set the subject of the meeting
oAppt.Subject = Selection.Text
'*** Select the agenda grid
Selection.GoTo What:=wdGoToBookmark, Name:="agenda"
Selection.Tables(1).Select
oAppt.Body =
Here we go. Two questions.
1º) When I do the Selection.SelectCell it selects the text that has
inside the cell, plus two strange characters (two squares). How do I
remove those characters before setting the properties.
2º) When I select the agenda grid I want to be able to set it in the
Body of the meeting request. I know I can do this using CTRL + C in
word and pasting into the body of the meeting request, but how do I do
this programatically ?
Thanks in advance!
Eduardo Ferrari