Pop the Task Creation Outlook form from Word

J

Jim Conrady

I am hoping this is relatively simple...

I have several word documents containing meeting minutes/technical
documentation. I want to be able to highlight a phrase, then execute a macro
that opens the standard Outlook Task Creation Dialog. I would like for the
highlighted phrase to be in the body of the task, and then I can easily fill
in the name, due date, etc., in the dialog.

One easy way I thought of would be to formulate the command line syntax and
then just execute the command line, but I cannot figure out how to do that,
either.

As you have probably deduced, I am fairly new to VBA... I have written a
few dozen VBA procedures in Excel but this is my first try at Word and/or
Outlook...

Help!

Jim
 
M

Michael Bauer [MVP - Outlook]

Am Sun, 17 Sep 2006 08:19:02 -0700 schrieb Jim Conrady:

If the code is located in Word you need to add a reference to Outlook via
Tools/References, if it´s in Outlook then add a ref to Word. After that you
can use the Object Browser (F2) to get a lot of informations about the
object models, their properties etc.

A task in Outlook you´d create with the CreateItem method. In Word you can
get the selection text with Window.Selection. You can call its Copy method
to copy that selection into the clipboard, but there´s no method in Outlook
to insert that clipboard content into an item´s Body.

This, e.g., writes a selected text into an item´s Body property, assuming
that Task is a valid object variable for the TaskItem and Wd one for a
Word.Document:

Task.Body = Wd.Windows(1).Selection.Text
 

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