See the answer in your other thread.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
"tmreyes" <(E-Mail Removed)> wrote in message
news:08BD63A0-8298-4341-815A-(E-Mail Removed)...
>i developed a form published to my personal folder that has command button
> and the code behind it does not run but when i run the code in VB editor
> it
> works.
> Here is the code:
> Sub CommandButton1_Click ()
> Dim myolApp As Outlook.Application
> Dim myinspector As Outlook.Inspector
> Dim myItem As Outlook.MailItem
> Dim myattachments As Outlook.Attachments
> Set myolApp = CreateObject("Outlook.Application")
> Set myinspector = myolApp.ActiveInspector
> If Not TypeName(myinspector) = "Nothing" Then
> Set myItem = myinspector.CurrentItem.Forward
> myItem.Recipients.Add "Reyes, Mark M [IT]"
> myItem.Send
> Else
> MsgBox "There is no active inspector."
> End If
> End Sub
>
> the code is to forward the form to an individual or PDL.
> any suggestions as to why the code does not work on the form?
>
> --
> thanks in advance,
> tmreyes