Ken -
I created the form and published it to a personal folder. i have a command
button on the form. when i run the form and click the button the code behind
the button does not work 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
any suggestions? thanks in advance
--
tmreyes
"Ken Slovak - [MVP - Outlook]" wrote:
> For information on all that to get you started look at www.outlookcode.com.
> There's information there on Outlook forms, setting up buttons and working
> with Outlook VBA macro code and COM addins.
>
> For future reference please post the Outlook version you are using so the
> appropriate answers can be provided.
>
> --
> 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:57DE4443-32A1-46F7-9AFC-(E-Mail Removed)...
> >I want to add a command button to a form that will send or forward the form
> > contents after it has been filled out to a predetermined PDL and the
> > person
> > that sent the form orginally. I am new to VB so looking for code examples.
> > thanks in advance.
> > --
> > tmreyes
>
>