Results 1 to 2 of 2
  1. #1
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Clickable URL to Outlook Folder (2000 +)

    <P ID="edit" class=small>(Edited by JohnBF on 19-May-05 08:08. Fixed the [%] display.)</P>Until today I didn't know you could create clickable Outlook Folder URLs. Why didn't you guys tell me? <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    This will place an Outlook Folder link on the users' clipboard, which can then be pasted into a document or Outlook Item. It requires a reference to the Forms Library be set in the Outlook VBE. It's valid for any Folder that a user has access to, but my main use is to send Public Folder links to other people in lieu of Shortcuts.

    Public Sub foldertreeinclipboard()
    Dim objFolder As MAPIFolder
    Dim obj As Object, objData As DataObject
    Dim strText As String

    Set objData = New DataObject
    On Error Resume Next
    If TypeName(Application.ActiveWindow) = "Explorer" Then
    Set obj = ActiveExplorer.Selection(1)
    Else
    Set obj = ActiveInspector.CurrentItem
    End If
    If Not obj Is Nothing Then
    If obj.Class = olFolder Then
    Set objFolder = obj
    Else
    Set objFolder = obj.Parent
    End If
    strText = Replace(objFolder.FolderPath, " ", "%20")
    strText = "<Outlook://" & Replace(Replace(strText, "!", "%21"), "#", "%23") & ">"
    objData.SetText strText
    objData.PutInClipboard
    MsgBox "This Outlook folder path is now in the clipboard: " & vbLf & strText
    End If
    Set objFolder = Nothing
    Set objData = Nothing
    End Sub

    I haven't had time to test if a URL to a specific Outlook item can be created.
    -John ... I float in liquid gardens
    UTC -7ąDS

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Clickable URL to Outlook Folder (2000 +)

    I finally got to researching if I could provide a clickable hyperlink to a specific Outlook Item. I found that if I add "" and the Item Subject to the Folder Path the hyperlink won't work (not on my machine, perhaps someone can test further)

    BUT if I add "" and the Item EntryID to the Folder Path the hyperlink DOES work, hence:

    Public Sub ItemOrFolderTreeInClipboard()
    Dim objData As DataObject
    Dim strText As String

    Set objData = New DataObject
    On Error Resume Next
    If TypeName(Application.ActiveWindow) = "Explorer" Then
    strText = ActiveExplorer.CurrentFolder.FolderPath
    Else
    With ActiveInspector.CurrentItem
    strText = .Parent.FolderPath
    strText = strText & "" & .EntryID
    End With
    End If
    If Not Err.Number Then
    strText = Replace(Replace(Replace(strText, " ", "%20"), "!", "%21"), "#", "%23")
    strText = "<Outlook://" & strText & ">"
    objData.SetText strText
    objData.PutInClipboard
    MsgBox "This Outlook folder or item is now in the clipboard: " & vbLf & strText
    End If
    Set objData = Nothing
    End Sub

    Anyone want to play with this for further insight? BTW, so far I have only been testing this on Message Items.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •