Selected document in another frame

Hi All,I need to modify Notes such a way that user is able to tag the individual mail in his folders/view with some identifier.

So to achieve this, I have created custom form where it contains text input and one button that does the whole.

I have modified the “Interrion MailFS” frameset so that custom form is displayed just below the preview frame.

Now my issue is I am not able to access the selected document in Inbox(any other folder/view) when I click on button.

to get the selected document i use

Dim oNotesUIWokSpace As NotesUIWorkspace

Set oNotesUIWokSpace = New NotesUIWorkspace

oNotesUIWokSpace.CurrentDocument, which gives me blank document. Also oNotesUIWokSpace.CurrentView is nothing in this case.

I am just speculating, but is this behaviour is beacuse Custom form and Folder/View are in different Frames?

Can I get any suggestion on this?

TIA

Subject: TargetFrame

Try using the NotesUIWorkspace method SetTargetFrame. Once you set the target frame, you may be able to use the NotesUIWOrkspace.CurrentView property to get the UI view and handles to the selected documents.

Subject: SetTargetFrame

Jim, Thanks for your reply.

Actually I have already tried the thing you suggested. Unfortunately it does not give expected result.

Set  	objNotesUIWorkspace = New NotesUIWorkspace	

objNotesUIWorkspace.SetTargetFrame("NotesView")

objNotesUIWorkspace.ViewRefresh

Messagebox objNotesUIWorkspace.CurrentDocument.GetItemValue("Subject")(0) 

Also i experienced weired behavior, sometimes it accesses document object properly whenever I am running the code in debug mode. But this does not happen all the time I am debugging.

Subject: Not sure, but try…

I’ve always had some troubles with multi-paned controls, but it can work. In looking at your code, I’d try getting the view handle, not the current doc.

Dim viewUI as notesuiview

dim dc as notesdocumentcollection

Set objNotesUIWorkspace = New NotesUIWorkspace

objNotesUIWorkspace.SetTargetFrame(“NotesView”)

objNotesUIWorkspace.ViewRefresh

set viewUI = objNotesUIWorkspace.CurrentView

set dc = viewUI.documents

set doc = dc.getfirstdocument

messagebox doc.GetItemValue(“Subject”)(0)

Good luck!