N
Neetu
Hello,
We are working on folders creation addin for outlook 2007 using VSTO.
We are creation set of folders inside add-in.
We have requirement -> not to allow user to drag any mailitem inside our
custom folder before login.
we have created a folderwrapper class and attaction events for all our folder
Add Item evnent
public virtual void Item_Add(object vobjItem)
{
MailItem lobjMailItem = null;
try
{
if (ClientInfo.Instance.LoginStatus == LoggedIn.No)
{
((MailItem)vobjItem).Move(Utility.SelectedFolder);
MessageBox.Show("You are not logged-in.Mail Has been
moved previous folder.Please login ");
return;
}
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
this code works fine , if we drags a folder from inbuilt folder of
Outlook like draft, inbox etc.
this also works fine , if we are doing ctrl + drag from some user created
folder.
however when we do simple drag from a user created folder .
((MailItem)vobjItem).Move(Utility.SelectedFolder);
code gives error "Mailitem cannot Move".
Utility.SelectedFolder -> a global variable to keep last selected folder to
move back the item back to last choosen folder.
Any help or tips are welcome.
We are working on folders creation addin for outlook 2007 using VSTO.
We are creation set of folders inside add-in.
We have requirement -> not to allow user to drag any mailitem inside our
custom folder before login.
we have created a folderwrapper class and attaction events for all our folder
Add Item evnent
public virtual void Item_Add(object vobjItem)
{
MailItem lobjMailItem = null;
try
{
if (ClientInfo.Instance.LoginStatus == LoggedIn.No)
{
((MailItem)vobjItem).Move(Utility.SelectedFolder);
MessageBox.Show("You are not logged-in.Mail Has been
moved previous folder.Please login ");
return;
}
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
this code works fine , if we drags a folder from inbuilt folder of
Outlook like draft, inbox etc.
this also works fine , if we are doing ctrl + drag from some user created
folder.
however when we do simple drag from a user created folder .
((MailItem)vobjItem).Move(Utility.SelectedFolder);
code gives error "Mailitem cannot Move".
Utility.SelectedFolder -> a global variable to keep last selected folder to
move back the item back to last choosen folder.
Any help or tips are welcome.