Outlook Script : Help!!

hello,



Can anyone help me please? I added Custom Menu items in Outlook and coded

this procedure for one of the menu items. I want to change the state of the

menu item (Checked/Unchecked). The same code works well in Visual Basic and

does not work in script-editor. I just can't access the command bar or the

controls in it thru' script. I tried the commented lines also Please tell

me what's wrong in this piece of code?



Function PreviewSub()

set CmdBars=Application.ActiveInspector.CommandBars

CtlCnt=CmdBars.Controls.Count

For I = 1 to CtlCnt

set CurCtl=CmdBars.Controls.Item(I)

Msgbox CurCtl.Caption

Next

'Set mypopup = CommandBars("CmdBarName")

'msgbox mypopup.Controls("MenuCaption").caption

'.FindControl("POP")

'mypopup.Controls("MenuCaption").State = NOT mypopup.Controls("MenuCaption").State

'If mypopup.Controls("MenuCaption").State = -1 Then 'msoButtonDown

' mypopup.Controls("MenuCaption").State = 0 ''msoButtonUp

'Else

' mypopup.Controls("MenuCaption").State = -1 'msoButtonDown

'End If

End Function


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories