Problems with Recipient.Add and Macro Signing ???

A

asousa

Hello,

I have created a custom message form in Outlook, where I deleted the
To: and Cc: fields, leaving only the Subject and Main Body, adding a
Image and some text.

I have save the Form in the Personal Form Library.

Afterwards I have created a Macro in Outlook with this code:

Sub DisplayForm()
Set myFolder = Session.GetDefaultFolder(olFolderInbox)
Set myItem = myFolder.Items.Add("IPM.Note.SuppRequest")
myItem.Display
myItem.Recipient.Add ("(e-mail address removed)")
End Sub

Then I noticed Outlook Macro restrictions were in effect and went on to
search out to Sign the Macro. But at this point the Macro itself was
working. It would display a warning, I would accept it, then the Macro
would show up, filling the To: field in the background and I would be
able to send the Macro.

As I mentioned I went on with my search for a Macro Signing procedure
accessible to my company. Eventually I used OpenSSL under Linux to
create a Root CA (which I will install in all client machines) and a
Client Certificate from which I extracted the P12 certificate.
Following this, I opened Outlook and signed the Macro, then resetting
the security level to "High".

Now the code >>> myItem.Recipient.Add ("(e-mail address removed)") <<< is
displaying a 438 error ( Object doesn't support this property or method
) when I debug the Macro.

This only happened after I signed it. Before it was working just fine.

Kind of wierd, not?

If anyone could help me, I would be greatly appreciated.

Best Regards,

Alexandre Sousa
 
S

Sue Mosher [MVP-Outlook]

There is no MailItem.Recipient object. It's Recipients:

myItem.Recipients.Add ("(e-mail address removed)")

You can also simply use:

myItem.To="(e-mail address removed)"

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
A

asousa

Sue,

Thanks once more. Now I felt really dumb. It's what happens when people
work under stress.
To avoid this happening again, do you have any website containing a
tree of objects and methods regarding the Outlook API?

Best Regards,

Alexandre Sousa
 
S

Sue Mosher [MVP-Outlook]

1) The object browser in Outlook VBA. Press F2.

2) MSDN.

3) References posted at http://www.outlookcode.com/d/outtech.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top