Creating appointment from a word document


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
 
Ad

Advertisements

M

Michael Bauer

Am 7 Jun 2006 12:44:16 -0700 schrieb (e-mail address removed):

1) Just cut them off:
dim s$
s=Selection.Text
s=left(s, len(s)-2)

2) For copy&paste into a TaskItem you´d need to use Redemption
(www.dimastr.com), because there´s no other usefull way to set the cursor.
 
E

emferrari

Thanks Michael

I did think about cut the chars off, but I tought would have a better
way to do it.

About the Redemption, does all users that will run the macro need the
redemption dll installed in order to run the macro? I did not find the
property to set the body of the appointment.

Thanks
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top