adding or substituting a telephone number in Outlook::_ContactItem

A

Acaccia

Hi to all (still you !? :eek:D) ...
Thank for yours previous suggestions... Now...another question... Is it
possible to add new telephone number type (e.g. Home 3) in
Outlook::ContactItem?
Otherwise so as that the new type of number to take the place of an old name
type (e.g. Home 3 substitute Fax (office)).

P.S. in last example, don'tcare if I retrieve phone data with
get_BusinessFaxNumber method for Home 3 number, I should modify only the
name displayed in contact item!

Thank's in advance. Bye!
Andrea
 
S

Sue Mosher [MVP-Outlook]

No, it is not possible to add another field that has the same functionality
as the built-in phone number fields. Nor can you change the list of phone
number fields or the name of any built-in field. You can, however, add
another simple text field and name it whatever you like.
 
A

Acaccia

Sue Mosher said:
No, it is not possible to add another field that has the same functionality
as the built-in phone number fields. Nor can you change the list of phone
number fields or the name of any built-in field.

D'oh! :eek:)
You can, however, add
another simple text field and name it whatever you like.

What it means exactly? Suppose that I wish to add a new text field and name
in the in the _Inspector of a contact item (e.g. named Home 3). How can I
memorize permanently this data like any other built-in telephone number?
Thank's a lot!
Andrea
 
A

Acaccia

Sue Mosher said:
You can design a custom form, add a new field named Home 3, and add a text
box for that field to any page. If you're new at forms design, see
http://www.outlookcode.com/d/forms.htm and
http://www.outlookcode.com/d/contactform.htm

Ok, I'm looking this interesting pages at this links...
Is it possible to load a customized form directly from my add-in? In
details, I want to create an installation wizard for my add-in... how can I
automatically install a customized form (e.g. creating an office template
file (oft))?

P.S. congratulations for your book, unfortunately it is dedicated especially
to VB developers (e.g. COM add-in parts), I hope that you are thinking to
write one about COM Office add-in for VC++ developers too. We need it!

Bye
Andrea
 
S

Sue Mosher [MVP-Outlook]

You can use the FormDescription.PublishForm method to programmatically
publish a custom form. See http://www.outlookcode.com/d/distributeforms.htm
Note that .oft files are used mainly for backing up custom form designs, not
creating new items.

I don't speak C++ and have no motivation to learn it.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Acaccia said:
"Sue Mosher [MVP-Outlook]" <[email protected]> ha scritto nel
messaggio
You can design a custom form, add a new field named Home 3, and add a
text
box for that field to any page. If you're new at forms design, see
http://www.outlookcode.com/d/forms.htm and
http://www.outlookcode.com/d/contactform.htm

Ok, I'm looking this interesting pages at this links...
Is it possible to load a customized form directly from my add-in? In
details, I want to create an installation wizard for my add-in... how can
I
automatically install a customized form (e.g. creating an office template
file (oft))?

P.S. congratulations for your book, unfortunately it is dedicated
especially
to VB developers (e.g. COM add-in parts), I hope that you are thinking to
write one about COM Office add-in for VC++ developers too. We need it!

Bye
Andrea
 
A

Acaccia

Sue Mosher said:
You can use the FormDescription.PublishForm method to programmatically
publish a custom form.

Ok... I have follow your suggestion and works fine... but there is a
problem: I have customized a form for a contact item but how can I publicize
this form so as that all old contacts that I have in my contacts list, take
on this modifies? Infact older contacts keep default contact form. I have
tried to publicize automatically my contact form with this code (porting it
from the VB code that you has suggest to me):

CComPtr <Outlook::_ContactItem> CustomContactItem;
CComPtr <Outlook::FormDescription> CustomFormDescription;

bstrName_T =_T("myForm.oft");
bstrName = bstrName_T.copy()
hr = m_spApp->CreateItemFromTemplate(bstrName,myFolder,(IDispatch**)
&CustomContactItem);
if(FAILED(hr)) {
AfxMessageBox("Failed to load the outlook form template");
}

//setting description of form

CustomContactItem->get_FormDescription(&CustomFormDescription);
bstrName_T = _T("MyForm");
bstrName = bstrName_T.copy();
CustomFormDescription->put_Name(bstrName);
Outlook::OlFormRegistry ofr = olFolderRegistry;
CComVariant myFolder(DISP_E_PARAMNOTFOUND, VT_ERROR);

//publicize the form

CustomFormDescription->PublishForm(ofr,myFolder); //myFolder is the default
value!

//close the item
Outlook::OlInspectorClose oic = olSave;
CustomContactItem->Close(oic);

and seem that it works fine... any further suggestions?
Bye Andrea
 
S

Sue Mosher [MVP-Outlook]

You publish the form only once, then you need to change the MessageClass
property on each item to set it to the class for that form.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Acaccia said:
"Sue Mosher [MVP-Outlook]" <[email protected]> ha scritto nel
messaggio
You can use the FormDescription.PublishForm method to programmatically
publish a custom form.

Ok... I have follow your suggestion and works fine... but there is a
problem: I have customized a form for a contact item but how can I
publicize
this form so as that all old contacts that I have in my contacts list,
take
on this modifies? Infact older contacts keep default contact form. I have
tried to publicize automatically my contact form with this code (porting
it
from the VB code that you has suggest to me):

CComPtr <Outlook::_ContactItem> CustomContactItem;
CComPtr <Outlook::FormDescription> CustomFormDescription;

bstrName_T =_T("myForm.oft");
bstrName = bstrName_T.copy()
hr = m_spApp->CreateItemFromTemplate(bstrName,myFolder,(IDispatch**)
&CustomContactItem);
if(FAILED(hr)) {
AfxMessageBox("Failed to load the outlook form template");
}

//setting description of form

CustomContactItem->get_FormDescription(&CustomFormDescription);
bstrName_T = _T("MyForm");
bstrName = bstrName_T.copy();
CustomFormDescription->put_Name(bstrName);
Outlook::OlFormRegistry ofr = olFolderRegistry;
CComVariant myFolder(DISP_E_PARAMNOTFOUND, VT_ERROR);

//publicize the form

CustomFormDescription->PublishForm(ofr,myFolder); //myFolder is the
default
value!

//close the item
Outlook::OlInspectorClose oic = olSave;
CustomContactItem->Close(oic);

and seem that it works fine... any further suggestions?
Bye Andrea
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top