Use VBA to insert hyperlink in Task Body
Works great he
taskitem.body="outlook://persönliche ordner/postausgang"
taskitem.subject="test"
taskitem.save
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6
Am Mon, 3 Sep 2007 08:34:02 -0700 schrieb showme1946:
Hi, Michael -
Yes, the link looks like that, but the way it looks is not the problem.
If I set .body equal to "outlook://Mailbox - Rickerson, George/Tasks/a
test
task", all I get in the task is that text string. It is not a hyperlink
that
I can click on to open that folder.
I need for the end result to be the same as it is when, in the Outlook
UI,
I click and drag a folder to a task. If you do that, you will see that
Outlook puts a hyperlink in the body of the task that can be used to open
the
folder; the hyperlink can also be edited using the hyperlink dialog box.
However, I am unable to find any way to mimic this behavior in a VB
program.
I learned somewhere while searching for a solution that a hyperlink is 3
text strings separated by the "#" character: the display string, the
address
string and the subaddress string. So I constructed such a string
(basically
it is the two text strings you see if you open the hyperlink dialog box)
and
set .body equal to it; but all I got was the text string - the whole
thing,
all 3 parts, with the delimiters; Outlook did not recognize it or treat it
as
a hyperlink.
I learned that one can get a hyperlink into an e-mail message using the
htmlbody property and constructing a html text string; the htmlbody is not
available for Tasks. One MS MVP on some forum suggested, in answer to
another person's question, using the EntryID of the folder; all I got was
a
really ugly text string in the Task body consisting of the EntryID.
Hope this additional information helps me find someone who knows the
answer.
thanksl
george.
"Michael Bauer [MVP - Outlook]" wrote:
The link looks like this:
outlook://Personal folder/Outbox
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6
Am Sun, 2 Sep 2007 15:26:01 -0700 schrieb showme1946:
Hello -
In Outlook I can drag an Outlook folder to a task, which results in a
hyperlink to the folder being inserted in the body of the task. How can
I
do
this programmatically in VBA (create the hyperlink to an Outlook
folder)?
I have found articles about how to do this in an e-mail message and in
Access, but Outlook Task lacks the elements those have to make this
work.
Assume that I've already created the task and the folder (the folder
holds
mail and post items) programmatically and know their names; and I know
the
path for the folder. The folder will hold e-mail and post items
pertaining
to the task, and I want a link to the folder in the task so that when
the
task is displayed, the user can immediately access the relevant
email/post
folder.
All help greatly appreciated.
thanks
George Rickerson
|