Dynamic "Text Box" - in .OFT Form is it possible?????

B

Baajhan

Outlook Form - Dynamic Creation of "Text Box"!!! is this possible?

Hello Everyone,

In outlook 2000 there is an option in the Tools menu >
Form Design > >> to create a FORM in outlook, that can be
used for creating / reading mails in a formatted manner.

These files are saved with the extention called (.OFT)

Well, these OFT can be created manually, my doubt is, can
our VB / VBA program create a dynamic form, with say a
TETBox and some radio buttons etc. etc.

Just the way we do in a VB Form, cn we have a control
array and generate fields, and set properties to them?

I have a strong feeling that this is possible.

Some one who has knowledge in this area please help.

Thanks for the time and consideration

regards,
Baajhan
 
K

Ken Slovak - [MVP - Outlook]

No control arrays in Outlook forms and the best practices advice is
not to try to create custom forms and populate them with controls on
the fly. The problem is this will create one-off items that are much
larger than they need to be, won't run any form code and won't be able
to be related to other items that use the same message class, in fact
the items will just be one-offed normal Outlook items.

You are best off creating the form as an OFT file and publishing it in
the users system, from code if necessary, and then using the custom
form.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


in message
news:[email protected]...
 
S

Sue Mosher [MVP-Outlook]

That said, there's nothing inherently wrong with using code to populate the
Controls collection and then publish the resulting custom form.

in message
No control arrays in Outlook forms and the best practices advice is
not to try to create custom forms and populate them with controls on
the fly. The problem is this will create one-off items that are much
larger than they need to be, won't run any form code and won't be able
to be related to other items that use the same message class, in fact
the items will just be one-offed normal Outlook items.

You are best off creating the form as an OFT file and publishing it in
the users system, from code if necessary, and then using the custom
form.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


in message
Outlook Form - Dynamic Creation of "Text Box"!!! is this possible?

Hello Everyone,

In outlook 2000 there is an option in the Tools menu >
Form Design > >> to create a FORM in outlook, that can be
used for creating / reading mails in a formatted manner.

These files are saved with the extention called (.OFT)

Well, these OFT can be created manually, my doubt is, can
our VB / VBA program create a dynamic form, with say a
TETBox and some radio buttons etc. etc.

Just the way we do in a VB Form, cn we have a control
array and generate fields, and set properties to them?

I have a strong feeling that this is possible.

Some one who has knowledge in this area please help.

Thanks for the time and consideration

regards,
Baajhan
 
B

baajhan s

Dear Sir,

Thanks first case.
Said that, it is not advisable to create the controls in the .OFT forms,
I will for sure keep an eye on it.

Can you please let me know how to dynamically create a textbox in an
eisting .OFT form in one of my physical paths.

Say i have a .OFT form called sample.oft in c:\myprojects\sample.oft

I have a VB program, that would want to put a control into this
sample.OFT form.

Can I do this?

Or will some code within the sample.oft should do this?

Soma sample would do much good....??


sincerely,
Baajhan
 
K

Ken Slovak - [MVP - Outlook]

Once you have the OFT file as an Outlook item (open it by using the
Outlook.Application.CreateItemFromTemplate method), you would get the
tab where you want the control added (assume it's a tab named "myTab")
and code it as follows:

Dim oPage As MSForms.Page
Dim oControls As MSForms.Controls
Dim oControl As MSForms.Control

Set oPage = oItem.GetInspector.ModifiedFormPages("myTab")
Set oControls = oPage.Controls
Set oControl = oControls.Add(Forms.TextBox.1, "ControlName", True)
'ControlName would be whatever you want it to be.
'See the Object Browser Help on the MSForms library and the
Controls.Add
'method to see how to use Add and what the ProgID's are for various
controls.

You then would have to set the various properties you want for the
textbox control. Some of the properties like Height and Width and Top
can only be set when the control is instantiated as an MSForms.Control
object, so you'd have to deal with that too.

If you also wanted to work with the properties specific to a Textbox
control you would have to instantiate a TextBox object or use
late-binding instead of early binding and declare the control as
Object to access properties specific to a TextBox object.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


in message
news:Oxb6nLw%[email protected]...
 

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