Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Problem with creating a custom command on FileSite
TakChi
I have difficulties to create a custom command on FileSite. Based on the examples from the documentation called [Creating Custom Commands in WorkSite.pdf] and the sample code from [WorkSite 8.2 SDK MyVBIManExt], I can use the right click menu from outlook and call the command to view the selected documents info. So, by this stage, you can consider everything is running fine including the setup is right and registry key setup is right…etc.
I know when getting the selected documents, it uses the value from [ContextItems collection], the code should look like
rpSelectedNRTDocuments = mContext("SelectedNRTDocuments"), where rpSelectedNRTDocuments is an array object of IManage.NRTDocument.
However if I change the sample code to get the selected folder info by using the value [SelectedNRTFolders], it gets an error like “Value does not fall within the expected range”. The code is like
rpSelectedNRTFolders = mContext("SelectedNRTFolders"), where rpSelectedNRTFolders is an array object of IManage.NRTFolder.
If converting to a simple version code in C#, I run something like
MessageBox.Show("Message 1");
object o = mContext.Item("SelectedNRTDocuments");
MessageBox.Show("Message 2");
Both message 1 and 2 popup normally, but when I run
MessageBox.Show("Message 1");
object o = mContext.Item("SelectedNRTFolders");
MessageBox.Show("Message 2");
There are only message 1 and error message popup. So I wonder the error message “Value does not fall within the expected range” is from WorkSite itself or from OutLook??
My original task is use the right click menu, and uses the command to get the selected WorkSpace info from FileSite on Outlook. From the documentation, it did not mention anything on SelectedWorkSpace, that’s why I was played around with the SelectedNRTFolders. So, can I ask is that right to treat a WorkSpace as a Folder or is there any ways to get the selected workspace info?
Can any one help me out with that??
Find more posts tagged with
Comments
1tchy
I have experienced a similar issue. When a document is selected it doesn't have a SelectedNRTFolder context item and vice versa for a folder. By using a try/catch you can get the array you need, as below.
Try
i = mContext.Item("SelectedNRTFolder")
msgbox(i.name)
Catch ex As Exception
End Try
One issue i am continuing to experience howver is that when a tab is selected it doesn't have an "SelectedNRTFolder" context item so i can't get a handle on it???
1tchy
FYI - Managed to get a handle on the tab by "SelectedFolderObject" as the context item instead of "SelectedNRTFolder"
TakChi
What if I want to get the selected workspace? Should I treat that as a FolderObject as well?
1tchy
Yes you can access a workspace through the SelectedFolderObject Context Item.
TakChi
Problem solved. Thanks. ;>