A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Use VBA to insert hyperlink in Task Body



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 2nd 07, 11:26 PM posted to microsoft.public.outlook.program_vba
showme1946
external usenet poster
 
Posts: 15
Default Use VBA to insert hyperlink in Task Body

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
Ads
  #2  
Old September 3rd 07, 06:26 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Use VBA to insert hyperlink in Task Body



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

  #3  
Old September 3rd 07, 04:34 PM posted to microsoft.public.outlook.program_vba
showme1946
external usenet poster
 
Posts: 15
Default Use VBA to insert hyperlink in Task Body

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


  #4  
Old September 3rd 07, 08:38 PM posted to microsoft.public.outlook.program_vba
showme1946
external usenet poster
 
Posts: 15
Default Use VBA to insert hyperlink in Task Body

Michael - if you do a search for "email hyperlink" and read the thread dated
6/28/07 you'll see successful instructions for programmatically putting a
hyperlink in the body of an e-mail using htmlbody. I basically want to do
the same think in the body of a Task, but htmlbody isn't available for tasks.
I have tried the method described in the 6/28/07 thread (except for the
htmlbody part of course) and it doesn't work.

thanks
George.

"showme1946" wrote:

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


  #5  
Old September 4th 07, 06:06 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default 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


  #6  
Old September 4th 07, 07:52 PM posted to microsoft.public.outlook.program_vba
showme1946
external usenet poster
 
Posts: 15
Default Use VBA to insert hyperlink in Task Body

Hmmm, perhaps I should move to your location. When I execute this code:
Set NewTask = CreateItem(olTaskItem)
With NewTask
.Subject = TaskSubj
.DueDate = TaskDue
.Body = "outlook://Mailbox - Rickerson, George/Tasks/Testfolder"
.Save
End With
NewTask.ShowCategoriesDialog
NewTask.Display

The result in the body of NewTask is a text string (including the angle
brackets) that is not a hyperlink. So, when you say "works great here" are
you saying than when you execute your code you have a hyperlink in your task?

thanks
George.


"Michael Bauer [MVP - Outlook]" wrote:



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


  #7  
Old September 5th 07, 07:47 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Use VBA to insert hyperlink in Task Body


I tested with OL 03. That works.

--
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 Tue, 4 Sep 2007 11:52:03 -0700 schrieb showme1946:

Hmmm, perhaps I should move to your location. When I execute this code:
Set NewTask = CreateItem(olTaskItem)
With NewTask
.Subject = TaskSubj
.DueDate = TaskDue
.Body = "outlook://Mailbox - Rickerson, George/Tasks/Testfolder"
.Save
End With
NewTask.ShowCategoriesDialog
NewTask.Display

The result in the body of NewTask is a text string (including the angle
brackets) that is not a hyperlink. So, when you say "works great here"

are
you saying than when you execute your code you have a hyperlink in your

task?

thanks
George.


"Michael Bauer [MVP - Outlook]" wrote:



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


  #8  
Old September 5th 07, 05:38 PM posted to microsoft.public.outlook.program_vba
showme1946
external usenet poster
 
Posts: 15
Default Use VBA to insert hyperlink in Task Body

I see. Pardon me for not noting earlier that I am using OL2007. I need a
way to accomplish this in OL07.

thanks
George.

"Michael Bauer [MVP - Outlook]" wrote:


I tested with OL 03. That works.

--
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 Tue, 4 Sep 2007 11:52:03 -0700 schrieb showme1946:

Hmmm, perhaps I should move to your location. When I execute this code:
Set NewTask = CreateItem(olTaskItem)
With NewTask
.Subject = TaskSubj
.DueDate = TaskDue
.Body = "outlook://Mailbox - Rickerson, George/Tasks/Testfolder"
.Save
End With
NewTask.ShowCategoriesDialog
NewTask.Display

The result in the body of NewTask is a text string (including the angle
brackets) that is not a hyperlink. So, when you say "works great here"

are
you saying than when you execute your code you have a hyperlink in your

task?

thanks
George.


"Michael Bauer [MVP - Outlook]" wrote:



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



  #9  
Old September 6th 07, 05:55 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Use VBA to insert hyperlink in Task Body



Sorry, I don' t know a solution for that.

--
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 Wed, 5 Sep 2007 09:38:02 -0700 schrieb showme1946:

I see. Pardon me for not noting earlier that I am using OL2007. I need a
way to accomplish this in OL07.

thanks
George.

"Michael Bauer [MVP - Outlook]" wrote:


I tested with OL 03. That works.

--
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 Tue, 4 Sep 2007 11:52:03 -0700 schrieb showme1946:

Hmmm, perhaps I should move to your location. When I execute this code:
Set NewTask = CreateItem(olTaskItem)
With NewTask
.Subject = TaskSubj
.DueDate = TaskDue
.Body = "outlook://Mailbox - Rickerson,

George/Tasks/Testfolder"
.Save
End With
NewTask.ShowCategoriesDialog
NewTask.Display

The result in the body of NewTask is a text string (including the angle
brackets) that is not a hyperlink. So, when you say "works great here"

are
you saying than when you execute your code you have a hyperlink in your

task?

thanks
George.


"Michael Bauer [MVP - Outlook]" wrote:



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



  #10  
Old September 6th 07, 01:27 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Use VBA to insert hyperlink in Task Body

Outlook 2007 uses Word as the email editor for all items. Therefore, you can use the Document.Hyperlinks.Add method from the Word object model to insert a link in the body of a task, something along these lines:

strLink = Replace("outlook://Mailbox - Rickerson, George/Tasks/Testfolder", " ", "%20")
strLinkText = "George's mailbox"
Set objInsp = NewTask.GetInspector
Set objDoc = objInsp.WordEditor
Set objSel - objDoc.Windows(1).Selection
objDoc.Hyperlinks.Add objSel.Range, strLink, _
"", "", strLinkText, ""

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"showme1946" wrote in message ...
Pardon me for not noting earlier that I am using OL2007. I need a
way to accomplish this in OL07.

Am Tue, 4 Sep 2007 11:52:03 -0700 schrieb showme1946:

Hmmm, perhaps I should move to your location. When I execute this code:
Set NewTask = CreateItem(olTaskItem)
With NewTask
.Subject = TaskSubj
.DueDate = TaskDue
.Body = "outlook://Mailbox - Rickerson, George/Tasks/Testfolder"
.Save
End With
NewTask.ShowCategoriesDialog
NewTask.Display

The result in the body of NewTask is a text string (including the angle
brackets) that is not a hyperlink.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
insert hyperlink me Outlook - General Queries 1 May 4th 07 03:42 PM
Save Attachment and insert hyperlink Ozgur Pars Outlook and VBA 1 February 5th 07 04:49 PM
insert as text (to insert html into email body) Iona Outlook - General Queries 1 July 13th 06 12:10 PM
vba code that insert a hyperlink file in the body of message gabriel Outlook and VBA 3 April 24th 06 01:51 PM
Insert a hyperlink to section of Word doc in an outlook message [email protected] Outlook - General Queries 0 February 8th 06 05:07 AM


All times are GMT +1. The time now is 06:10 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-2025 Outlook Banter.
The comments are property of their posters.