Windows Vista Forums

Re: Powershell+ outlook: How to bookmark an email?
  1. #1


    Shay Levy [MVP] Guest

    Re: Powershell+ outlook: How to bookmark an email?

    Hello Vijay,


    With Outlook 2007 I can do this (didn't check on 2003):




    $olFolderInbox = 6
    $outlook = new-object -com outlook.application
    $ns = $outlook.GetNameSpace("MAPI")
    $inbox = $ns.GetDefaultFolder($olFolderInbox)

    # print messages subject and entryid
    #$inbox.items | fl subject,EntryID


    To get (display) a specific message, for example the first item in inbox:

    $i = $inbox.items.getFirst()
    $ns.GetItemFromID($i.entryId).display()




    ---
    Shay Levy
    Windows PowerShell MVP
    http://blogs.microsoft.co.il/blogs/ScriptFanatic
    PowerShell Toolbar: http://tinyurl.com/PSToolbar


    V> any suggestions on how I should progress?
    V> regards
    V> Vijay
    V> On Jan 19, 1:13 pm, vijay <jahagirdar...@xxxxxx> wrote:

    >> Hi,
    >> I would like to bookmark specific emails send the list of bookmarks
    >> to
    >> a different application where it will be hyperlinked to the original
    >> mail so that clicking on the hyperlink will open the corresponding
    >> mail in outlook.
    >> I would have expected the task to be that of retriving the message-ID
    >> from the mail header (A function equivalent to "String
    >> msgID=outlook.eMail.getMessageID" ) and later displaying the email
    >> using a function equivalent to "outlook.eMail.openEmailByMessageID
    >> ('ID')"
    >>
    >> On searching this forum the only thread I have found so far is
    >>
    >> http://groups.google.com/group/micro....powershell/br
    >> ...
    >>
    >> Which provides a non-unique way of performing this operation based on
    >> subject String.
    >>
    >> Are there function equivalent to the two functions listed by me? What
    >> is the closest approximation that I can use to get the desired
    >> behavior?
    >> regards
    >> Vijay


      My System SpecsSystem Spec

  2. #2


    Shay Levy [MVP] Guest

    Re: Powershell+ outlook: How to bookmark an email?


    You can use a builtin method:


    $inbox.items.GetFirst()

    - or -

    $inbox.items.GetLast()



    ---
    Shay Levy
    Windows PowerShell MVP
    http://blogs.microsoft.co.il/blogs/ScriptFanatic
    PowerShell Toolbar: http://tinyurl.com/PSToolbar


    >> $inbox.items|fl subject,entryid|select -first 1
    >>
    >> That doesn't seem to work for me...
    >>
    M> D'oh... Never mind... Format-* must always be the last cmdlet in a
    M> pipeline...
    M>
    M> Marco
    M>



      My System SpecsSystem Spec

Re: Powershell+ outlook: How to bookmark an email? problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
printing the attachments on email in Outlook from a PowerShell script Larry__Weiss PowerShell 2 19 Apr 2010
Bookmark!!! There's no add bookmark when I rightclick the bar in I redfoxhound .NET General 1 01 Jun 2009
My new Vista PC IE will not import my bookmark.htm file from XP PC Andre Da Costa[ActiveWin] Vista General 1 19 Nov 2007
Bookmark Help File in Vista vanilla Vista General 5 16 Jul 2007
Bookmark & Annotation in XPS document Vijay Avalon 0 10 Jan 2006