A
Anurag Batra
Hello,
This was working in Outlook 2002. Using vbscript we created a button
that opened an oft file when clicked. We did this because it was
deployed to a number of employees. They have a button on their toolbar
which when they clicked launched the form. However now we are moving
to Outlook 2007 and now we face a bunch of problems. It does not work
at all. So this is what I have done till now.
First the custom form was published and deployed to the Organization
group. After that I created a macro that would launch the form. It
works but everytime I logon to the test machine and try to run the
macro it gives a security message alert. How can we avoid that? Once I
click ok it works fine from there. Below is the code for the macro.
--------------------------
Sub MyHandler()
Set myFolder = Session.GetDefaultFolder(olFolderCalendar)
Set myItem = myFolder.Items.Add("IPM.Note.CPSCallReports")
myItem.Display
Set objTasks = Nothing
Set objTask = Nothing
'MsgBox ("button clicked...yipee!!")
End Sub
-------------------------
The macro works fine when you launch it manually.
Now I have vbscript code that creates the toolbar button which when
clicked tries to launch the macro. The script when run creates the
toolbar button. But nothing happens when you click on the button.
-----------------------------------
Dim oActExp
Dim cmdbar
Dim cmdbtn
Set olApp = CreateObject("Outlook.Application")
set oActExp = olApp.ActiveExplorer
Set cmdbar = oActExp.CommandBars.Add("Open Custom Forms Bar", 1)
set cmdbtn = oActExp.CommandBars("Open Form").Controls.Add(1)
With cmdbtn
.Caption = "Call Report"
.OnAction="MyHandler"
End With
cmdbar.Visible = True
cmdbtn.Visible = True
msgbox("Setup complete!")
-----------------------------------
I have tried various options of OnAction event but nothing happens. I
even tried to do this
..OnAction = MsgBox("foo")
but nothing happened as well.
My final goal is to have a vbscript which I can ask users to run on
their machine which would create the button and the macro. The form is
already deployed.
regards,
Anurag
This was working in Outlook 2002. Using vbscript we created a button
that opened an oft file when clicked. We did this because it was
deployed to a number of employees. They have a button on their toolbar
which when they clicked launched the form. However now we are moving
to Outlook 2007 and now we face a bunch of problems. It does not work
at all. So this is what I have done till now.
First the custom form was published and deployed to the Organization
group. After that I created a macro that would launch the form. It
works but everytime I logon to the test machine and try to run the
macro it gives a security message alert. How can we avoid that? Once I
click ok it works fine from there. Below is the code for the macro.
--------------------------
Sub MyHandler()
Set myFolder = Session.GetDefaultFolder(olFolderCalendar)
Set myItem = myFolder.Items.Add("IPM.Note.CPSCallReports")
myItem.Display
Set objTasks = Nothing
Set objTask = Nothing
'MsgBox ("button clicked...yipee!!")
End Sub
-------------------------
The macro works fine when you launch it manually.
Now I have vbscript code that creates the toolbar button which when
clicked tries to launch the macro. The script when run creates the
toolbar button. But nothing happens when you click on the button.
-----------------------------------
Dim oActExp
Dim cmdbar
Dim cmdbtn
Set olApp = CreateObject("Outlook.Application")
set oActExp = olApp.ActiveExplorer
Set cmdbar = oActExp.CommandBars.Add("Open Custom Forms Bar", 1)
set cmdbtn = oActExp.CommandBars("Open Form").Controls.Add(1)
With cmdbtn
.Caption = "Call Report"
.OnAction="MyHandler"
End With
cmdbar.Visible = True
cmdbtn.Visible = True
msgbox("Setup complete!")
-----------------------------------
I have tried various options of OnAction event but nothing happens. I
even tried to do this
..OnAction = MsgBox("foo")
but nothing happened as well.
My final goal is to have a vbscript which I can ask users to run on
their machine which would create the button and the macro. The form is
already deployed.
regards,
Anurag