How Hidden Tab - Custom Form

G

Guest

Hi
I use Outlook 2003
I've a Custom Form (type Messagge) with two Tab (the standard tab and the
custom tab)
I open my custom form (the custom tab is selected), I compile it and I click
to the Send button.
The body text is compose automatically.
When I recive the mail, I don't want see the custom tab, but only the
standard tab.
Is it possible?
With my script I see both
My script is:

Function Item_Open()
Dim objInsp 'As Object

strNameTab = "P.2"
' show custom tab
Set objInsp = Item.GetInspector
objInsp.SetCurrentFormPage strNameTab

' set controls collection(s)
Set objControls = objInsp.ModifiedFormPages(strNameTab).Controls
Set txtData = objControls("txtData")
Set objInsp = Nothing
End Function

Function Item_Send()

Dim objInsp 'As Object

'Set Mail Text and Format *
With Item
.BodyFormat = 3
.Body = txtData.Text & Chr(10) & .Body
End With

'Hide Tab *
Set objInsp = Item.GetInspector
objInsp.HideFormPage strNameTab
Set objInsp = Nothing

End function
 
S

Sue Mosher [MVP-Outlook]

Putting HideFormPage will do you no good. A form always opens in its
published state.

Instead, reverse the process. Hide the page in the published form and use
ShowFormPage in the Item_Open event to show it if it's a new item.
 
G

Guest

Yes.
I've hidden the custom tab in the published form and in the Item_Open event
I put the code:
objInsp.ShowFormPage "Message"
objInsp.ShowFormPage "CustomTab"
objInsp.SetCurrentFormPage "CustomTab"

In this mode, I see the CustomTab when click "New", and when I recive the
mail I can see only standard tab.

Thank for you confirmation
 
S

Sue Mosher [MVP-Outlook]

FYI, this is also a really good technique for preventing a form from being
used if it gets into a one-off state.

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

Guest

Thanks, Sue

Sue Mosher said:
FYI, this is also a really good technique for preventing a form from being
used if it gets into a one-off state.

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

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