Property Page in Addin

  • Thread starter Thread starter Nauman Khan
  • Start date Start date
N

Nauman Khan

Hi!

I'm writting my Outlook Adding using VC6 and ATL. And now I
experienced problem when trying to add my addin's property page to
Tools->Options notebook.

This how I'm adding page:

void _stdcall OnOptionPagesAdd(IUnknown* Pages)
{
CComQIPtr<Outlook::PropertyPages> spPages(Ctrl);
ATLASSERT(spPages);

//ProgId of the propertypage control
CComVariant varProgId(OLESTR("OutlookAddin.ConfigurationPage"));

//tab text
CComBSTR bstrTitle(OLESTR("Account"));

HRESULT hr = spPages->Add((_variant_t)varProgId,(_bstr_t)bstrTitle);
if(FAILED(hr))
MessageBox(NULL, _T("Failed adding propertypage"), _T(""), MB_OK);
}

All wokrks fine. I'm able to open Tools->Options and see my page name
between the others. But when I clicking on it, Outlook displays the
following message:

"Unable to display "Account" page. This page will remain visible, but
is not available".

Can anyone help me to solve this problem?

Regards
Nauman
 
That means that there was an error initializing your control. What
interfaces does OutlookAddin.ConfigurationPage object implement?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Hi!

I'm writting my Outlook Adding using VC6 and ATL. And now I
experienced problem when trying to add my addin's property page to
Tools->Options notebook.

This how I'm adding page:

void _stdcall OnOptionPagesAdd(IUnknown* Pages)
{
CComQIPtr<Outlook::PropertyPages> spPages(Ctrl);
ATLASSERT(spPages);

//ProgId of the propertypage control
CComVariant varProgId(OLESTR("OutlookAddin.ConfigurationPage"));

//tab text
CComBSTR bstrTitle(OLESTR("Account"));

HRESULT hr = spPages->Add((_variant_t)varProgId,(_bstr_t)bstrTitle);
if(FAILED(hr))
MessageBox(NULL, _T("Failed adding propertypage"), _T(""), MB_OK);
}

All wokrks fine. I'm able to open Tools->Options and see my page name
between the others. But when I clicking on it, Outlook displays the
following message:

"Unable to display "Account" page. This page will remain visible, but
is not available".

Can anyone help me to solve this problem?

Regards
Nauman
 
Hi all,

I have an outlook form, which has some custom controls in addition to To,
Subject, Message fields. IS it possible to do something like this

1- Call a function in Addin and pass all the values on the form to Addin [I
have done it]
2- Create IMessage object, add the values including values for my custom
control values as key/value to that object?
3- Create entry in say Sent folder for these custom messages.

** I am using VC++6 for Development with Outlook 2003 and above.

Please help
Regards
Nauman
 
Please create a new thread instead of reusing an old one.
I am not exactly sure what you are trying to do. You can create a new
message in the Sent Items folder usign MAPIFolder.Items.Add. Custom
properties can be added using MailItem.UserProperties collection.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Thanks for your reply.
I basically create a custom message and send it through my own web server.
But i need to do following

1- If the Message is successfully sent, Create an entry in Sent Folder for
my message
2- If message is not Sent, I will create an entry in "Unsent Messages"
folder.

I tried your suggestion and it seems to work. Just one more explaination -
Once i have saved the Form to the Folder, will these custom properties stay
persistent ? i mean if i open the form in Design Mode from within Outlook, i
see those properties there with their values. This could interrupt with
default functionality of the form, as i am also using it to Create Message
on click on Addin Button. Any ideas ?

Regards
Nauman

Dmitry Streblechenko (MVP) said:
Please create a new thread instead of reusing an old one.
I am not exactly sure what you are trying to do. You can create a new
message in the Sent Items folder usign MAPIFolder.Items.Add. Custom
properties can be added using MailItem.UserProperties collection.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Nauman Khan said:
Hi all,

I have an outlook form, which has some custom controls in addition to To,
Subject, Message fields. IS it possible to do something like this

1- Call a function in Addin and pass all the values on the form to Addin [I
have done it]
2- Create IMessage object, add the values including values for my custom
control values as key/value to that object?
3- Create entry in say Sent folder for these custom messages.

** I am using VC++6 for Development with Outlook 2003 and above.

Please help
Regards
Nauman
 
I am not sure what you mean by "Form". Are you designing a custom form?
Everything displayed by a built-in or a custom form is bound to the message.
The data does not exist in a form, only in the messages.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Nauman Khan said:
Thanks for your reply.
I basically create a custom message and send it through my own web server.
But i need to do following

1- If the Message is successfully sent, Create an entry in Sent Folder for
my message
2- If message is not Sent, I will create an entry in "Unsent Messages"
folder.

I tried your suggestion and it seems to work. Just one more explaination -
Once i have saved the Form to the Folder, will these custom properties stay
persistent ? i mean if i open the form in Design Mode from within Outlook, i
see those properties there with their values. This could interrupt with
default functionality of the form, as i am also using it to Create Message
on click on Addin Button. Any ideas ?

Regards
Nauman

Dmitry Streblechenko (MVP) said:
Please create a new thread instead of reusing an old one.
I am not exactly sure what you are trying to do. You can create a new
message in the Sent Items folder usign MAPIFolder.Items.Add. Custom
properties can be added using MailItem.UserProperties collection.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Nauman Khan said:
Hi all,

I have an outlook form, which has some custom controls in addition to To,
Subject, Message fields. IS it possible to do something like this

1- Call a function in Addin and pass all the values on the form to
Addin
[I
have done it]
2- Create IMessage object, add the values including values for my custom
control values as key/value to that object?
3- Create entry in say Sent folder for these custom messages.

** I am using VC++6 for Development with Outlook 2003 and above.

Please help
Regards
Nauman
 
Back
Top