Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email hyperlink to Outlook folder

Status
Not open for further replies.

PatSalmon

Technical User
Jul 5, 2001
27
CA
I would like to send an email with a hyperlink to an Outlook folder.
This is part of the code I have so far.

.Subject = "Inventory Adjustment Approval" 'Forms!frmMail!Subject

strBody = "<Outlook://Public%20Folders/All%20Public%20Folders/Production/z%20InventoryAdjustmentsApproval%20(under%
20construction)>"


.Body = strBody
.Importance = olImportanceHigh 'High importance


This does produce the text in the email, but it is not a hyperlink. I do have some sample code to create a hyperlink from a file, that works, but something seems to be different for an outlook folder.

Does anyone know how to make it work?

Thanks,
Pat
 
Try:
[tt].HTMLBody = strBody[/tt]

CMP

Funny thing about being unemployed, weekends don't mean quite so much, just means you get to hang out with your working friends. Primus
 
When I do that the message body is blank. Do I need to do anything to the strBody statement?

Thanks,
Pat
 
You may need to add the HTML code for a link, I think it is

[tt]<LINK URL="<Outlook://Public%20Folders/All%20Public%20Folders/Production/z%20InventoryAdjustmentsApproval%20(under%
20construction)>">Link Name Here</LINK>[/tt]

CMP

Funny thing about being unemployed, weekends don't mean quite so much, just means you get to hang out with your working friends. Primus
 
Crap, it's not a LINK tag, it's an Anchor tag.
[tt]<A> </A>[/tt] and you'll need to double check if it taks a [tt]SRC[/tt] or [tt]URL[/tt] argument.

Sorry about that, I'm so used to doing Tek-Tips markup language it's the first thing that comes to mind.

CMP

Funny thing about being unemployed, weekends don't mean quite so much, just means you get to hang out with your working friends. Primus
 
Thanks for your suggestions.

I get a compile error with the following code:

strBody = <A>="<Outlook://Public%20Folders/All%20Public%20Folders/Production/z%20InventoryAdjustmentsApproval%20(under%20construction)>">Link Name Here</A>

I'm not very HTML literate and don't under stand the "Link Name Here" part.
Cheers,
PAt
 
[tt]strBody = "<A HREF='<Outlook://Public%20Folders/All%20Public%20Folders/Production/z%20InventoryAdjustmentsApproval%20(under%20construction)>'>[blue]This is the text that will appear for the link[/blue]</A>"[/tt]

The whole bit needs to be written to [tt]strBody[/tt], HTML tags and all.

Link Name Here is the text that appears in the email body and corresponds the link. For your purpose you might make it equal to:
[tt]//Public Folders/All Public Folders/Production/z InventoryAdjustmentsApproval (under construction)[/tt]
So your users can see where it points to.

CMP

Funny thing about being unemployed, weekends don't mean quite so much, just means you get to hang out with your working friends. Primus
 
Thanks so much for all of your help. We are getting really really close. [smile2] The link text does appear to be a link. but perhaps there is a problem with the syntax for the outlook folder. when i paste

<Outlook://Public%20Folders/All%20Public%20Folders/Production/z%20InventoryAdjustmentsApproval%20(under%20construction)>

into an email and hit enter to activate the link, it finds the correct folder.

But using the HTML code you have given me opens up a "Locate Link Browser" window.

Thanks again,
Pat
 
I almost have this working. [upsidedown]

This is my code:

strBody = "<A HREF='<Outlook://Public%20Folders/All%20Public%20Folders/Production/z%20InventoryAdjustmentsApproval%20(under%20construction)>'>This is the text that will appear for the link</A>"

This puts what appears to be a link in the body of the email. when i hover my mouse over it the address looks fine. But when I click the link it opens up a "Locate Link
Browser" window.

When I paste

<Outlook://Public%20Folders/All%20Public%20Folders/Production/z%20InventoryAdjustmentsApproval%20(under%20construction)>

into an email and hit enter to activate the link, it finds the correct folder.

It seems like the syntax for the outlook folder is very particular. Does anyone have any idea how to finish this off?

Thanks,
Pat

 
Sorry about the delay in responding, life has been happening.

For grins & giggles try removing the [tt]%20[/tt] from the [tt]HREF[/tt] and see what happens.
Code:
strBody = "<A HREF='<Outlook://Public Folders/All Public Folders/Production/z InventoryAdjustmentsApproval (under construction)>'>This is the text that will appear for the link</A>"

I don't have an exchange environment to work in so I'm taking stabs in the dark since I don't have a way to test this.

CMP


Funny thing about being unemployed, weekends don't mean quite so much, just means you get to hang out with your working friends. Primus
 
I get the same result. Opens up a "Locate Link Browser" window. This tells me that it doesn't recognize the path at all. According to the Microsoft the angle brackets are required for the outlook folder path. I think that it seems to get confused with the angle brackets used in HTML. Just my wild guess [hairpull]. i haven't had much experience building an HTML statement.

Thanks for your patience.
Pat
 
Ok, now I'm just stumped. I tried this in Outlook 2k (SP2) and it worked (I went back to the original [tt].Body[/tt] concept):
Code:
Public Sub TestItemLink()
Dim objNameSpace As NameSpace
Dim fldDefault As MAPIFolder
Dim itmMail As MailItem
Set objNameSpace = GetNamespace("MAPI")
Set fldDefault = objNameSpace.GetDefaultFolder(olFolderInbox)
Set itmMail = fldDefault.Items.Add
With itmMail
  .Body = "<Outlook://Finance/(Test%20Folder)>"
  .Subject = "Folder Test 4"
  .Save
End With
CleanUp:
Set itmMail = Nothing
Set fldDefault = Nothing
Set objNameSpace = Nothing
End Sub

When I open the saved message the link worked perfectly with the link appering as:
<[blue]Outlook://Finance/(Test%20Folder)[/blue]>
The brackets DO NOT appear as part of the link, but when I click it opens the folder.

Not sure what where the disconnect is, if I have time I may try to fire this code from Access and see if the functionality changes.

CMP


Funny thing about being unemployed, weekends don't mean quite so much, just means you get to hang out with your working friends. Primus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top