Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Creating appointment from a word document (http://www.outlookbanter.com/outlook-vba/17124-creating-appointment-word-document.html)

[email protected] June 7th 06 08:44 PM

Creating appointment from a word document
 
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.olAppointmentIt em)

'*** 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


Michael Bauer June 8th 06 07:25 AM

Creating appointment from a word document
 
Am 7 Jun 2006 12:44:16 -0700 schrieb :

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.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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.olAppointmentIt em)

'*** 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


[email protected] June 8th 06 01:53 PM

Creating appointment from a word document
 
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

Michael Bauer wrote:
Am 7 Jun 2006 12:44:16 -0700 schrieb :

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.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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.olAppointmentIt em)

'*** 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



Michael Bauer June 9th 06 05:56 AM

Creating appointment from a word document
 
Am 8 Jun 2006 05:53:13 -0700 schrieb :

Yes, the library needs to be on every computer.

Here´re some samples:
http://www.dimastr.com/redemption/safeinspector.htm

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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

Michael Bauer wrote:
Am 7 Jun 2006 12:44:16 -0700 schrieb :

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.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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.olAppointmentIt em)

'*** 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



All times are GMT +1. The time now is 06:43 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com