Link to home
Start Free TrialLog in
Avatar of dansir97
dansir97

asked on

selected item object in view control in folder home page

Having an outlook view control in a DHTML page used as a MAPIfolder home page, I can't find a way to get the Item
Object currently selected in the view control.
Selection is a property of Explorer, but
it seems to be empty or there is no Explorer for a folder home page?
I know I can use the Open method to open
the Item, but it's not a good solution
for me.
Anyone with an idea?
Thanks
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Hi dansir97,

Don't know if it helps but worth to look at

from the Digital Dashboard Guide

"By default Outlook Today hosts a subset of Internet Explorer to achieve the best possible rendering performance.

Outlook Today is capable of hosting the full Internet Explorer functionality at a small performance penalty. When Outlook displays a Web page or folder home page, it uses the complete version of Internet Explorer. The complete version enables back and forward buttons, full Iframe support and, most important, support for the Internet Explorer Offline cache.
Switching to the Full Version of Internet Explorer
More sophisticated digital dashboard solutions will require the full version of Internet Explorer. The full version allows a much greater degree of development flexibility and the ability to take the page offline, even if hosted on a Web server. You can use the full version of Internet Explorer to display Outlook Today by adding two settings to the Microsoft Windows® registry.
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\9.0\Outlook\Webview\mailbox]
"url"=http://digidash/home.htm (Enter the location of your digital dashboard here.)
"navigation"="yes"

Note:   If you switch to the full version of Internet Explorer, you lose all the performance enhancements associated with using a DLL. For example, the RENSTATICTABLE tables are no longer displayed when the page first loads, and your data is displayed more slowly.
"

Hope this helps,
:O)Bruintje
Avatar of SMosher
SMosher

The Outlook View Control itself provides no Selection object like an Explorer does. However, if the OVC displays the same folder as the Explorer window for which it's the folder home page, you should be able to get the Selection from the ActiveExplorer.
Avatar of dansir97

ASKER

Thanks for the answers.

I progressed a bit and I am now able
to get A selection. The problem is that
I get the selection of the explorer
window under my home page with the view
control. So, after changing the selection in my view control, I still
get the original selection in the outlook explorer. Maybe there is a way
to force synchronisation on the explorer
before getting the item selected.
I am still working on it.
I think there may be something in how you initialize the OVC. If you change the folder that the OVC is displaying, it won't remain tied to the home page's folder.
BUt the OVC is displaying the Inbox by
default and it doesn't matter on which
folder your home page is. So I don't
think I have a choice but changing
the folder. By the way, in my test the
folder displayed is also the current
folder; If there is any kind of synchro.
I don't disturb it.

Thanks for the answers
The OVC defaults to Inbox only if you don't set the folder. For example, here's the HTML I use on an OVC on a home page to go with the Contacts folder. Note the Folder parameter:

<object classid="clsid:0006F063-0000-0000-C000-000000000046" width="771" height="458" id="OVCtl1">
  <param name="View" value="Phone List">
  <param name="Folder" value="\\Personal Folders\Contacts">
  <param name="Namespace" value="MAPI">
  <param name="DeferUpdate" value="0">
</object>

Now, if I set this as the home page for the Contacts folder and turn it on, select a couple of items and run this code in my VBA window, it lists the contacts I selected in the OVC:

Sub CheckOVCSelection()
    Set objApp = CreateObject("Outlook.application")
    Set objSel = objApp.ActiveExplorer.Selection
    For Each objItem In objSel
        Debug.Print objItem.Subject
    Next
End Sub


Thanks but I must set the OVC Folder property during run time, because I use
the same home page for different public folders and I switch to other folders
following user interaction.
Anyway, and after I have been told by some "experts" that it can't be done,
It finally works and I don't know what change I made who did the trick.
At least, I have a working example!

Thanks
ASKER CERTIFIED SOLUTION
Avatar of SMosher
SMosher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial