PC Review


Reply
Thread Tools Rate Thread

I create a menu item using VB, within a custom contacts form. I do not want the item to be visible in other forms or views. How do I do this??

 
 
Tore
Guest
Posts: n/a
 
      10th Mar 2004
I have created an OCX in VB.
It works like this:
I have a custom form in my Contacts folder.
In that form I have created a custom page.
Have inserted my OCX in that page.

I now open my form by clicking on one of the entries
in my contacts folder...

Then I click on my custom page tab in that form which
triggers UserControl_Show event for my form in my OCX.

This event runs my menu item creation code and I'm a happy guy.

Menu before my code....
.... Tools Actions Help TestMenu (where TestMenu was inserted
manually)
after my code was triggered
.... Tools Actions Help TestMenu
TestMenuItem (newly created by my code)

So far everything seems nice, however... if I now opens another form
in another folder (this folder is not using my custom made form above)
this form will also show my newly created menuItem.

______ This is my main question ________
Is it possible to create a menuItem which is only visible from the
form, or even better only from the combination form/window that
actually run the code below?
______ End main question _______

Is there perhaps some properties that make this menuItem only visible
from
the window that the menuItem was created in.

Any clean solution to this or perhaps some workaround?


********* THE CODE *******
Private Sub UserControl_Show()
Dim objApp As Outlook.Application
Set objApp = CreateObject("Outlook.Application")

Set colCB = objApp.ActiveInspector.CommandBars
For Each objCB In colCB
'strMainMen = strMainMen & ", " & objCB.Caption
For Each objControl In objCB.Controls
If objControl.Caption = "TestMenu" Then

Set objCBCs = objControl.Controls
Set objCBB = objCBCs.Add
objCBB.Caption = "TestMenuItem"
End If
Next
Next
end sub
******* END THE CODE ******

Tore
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable custom menu item based on visible cells stewart Microsoft Excel Programming 1 1st Jan 2008 05:46 PM
Create custom context menu item for text selection Monty Microsoft Windows 2000 Registry 0 13th Feb 2007 09:12 PM
create a custom winxp shell menu item? Al Windows XP Customization 6 11th Feb 2007 12:16 AM
custom form as forwarded item not visible in other Exchange org a6avant@hotmail.com Microsoft Outlook Form Programming 9 6th May 2006 12:00 PM
Create Menu item for custom form Aldero Microsoft Outlook Form Programming 1 4th Aug 2004 02:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:32 AM.