Note that there are some explanatory texts on larger screens.

plurals
  1. POOpen mails in outlook from java using the protocol "mapi://"
    primarykey
    data
    text
    <p>I developp a Java application using Windows Desktop Search from which I can retrieve some information about files on my computer such as urls (<a href="http://msdn.microsoft.com/en-us/library/bb760785(VS.85).aspx" rel="nofollow noreferrer">System.ItemUrl</a>). An example of such url is</p> <pre><code>file://c:/users/ausername/documents/aninterestingfile.txt </code></pre> <p>for "normal" files. This field give also urls of mail items indexed from Outlook or Thunderbird. Thunderbird's items (only available using vista and seven) are also files (.wdseml). But outlook's items urls start with "mapi://" like :</p> <pre><code>mapi://{S-1-5-21-1626573300-1364474481-487586288-1001}/toto@mycompany.com($b423dcd5)/0/Inbox/가가가가곕갘객겒갨겑곓걌게겻겨곹곒갓곅갩갤가갠가 </code></pre> <p>The problem I have is opening the real item from Java in Outlook using this url. If I copy/paste it in the run dialog of Windows, it works ; it also works if I use "start" followed by the copied/pasted url in command line.</p> <p>The url seems to be encoded in UTF-16. I want to be able to write such code :</p> <pre><code>String url = "mapi://{S-1-5-21-1626573300-1364474481-487586288-1001}/toto@mycompany.com($b423dcd5)/0/Inbox/가가가가곕갘객겒갨겑곓걌게겻겨곹곒갓곅갩갤가갠가"; Runtime.getRuntime().exec("cmd.exe /C start " + url); </code></pre> <p>I doesn't work and I've tried other solutions like :</p> <pre><code>String start = "start"; String url = "mapi://{S-1-5-21-1626573300-1364474481-487586288-1001}/toto@mycompany.com($b423dcd5)/0/Inbox/가가가가곕갘객겒갨겑곓걌게겻겨곹곒갓곅갩갤가갠가"; FileOutputStream fos = new FileOutputStream(new File("test.bat"); fos.write(start.getBytes("UTF16"); fos.write(url.getBytes("UTF16")); fos.close(); Runtime.getRuntime().exec("cmd.exe /C test.bat"); </code></pre> <p>without any success. Using the solution above, the file "test.bat" contains the correct url and the "start" command, but the run of "test.bat" results in the well known error message :</p> <pre><code>'■' is not recognized as an internal or external command, operable program or batch file. </code></pre> <p>Has anybody an idea to be able to open "mapi://" items from Java ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload