Recurring message with attachment

D

Duane Thomas

I followed this MS article to create a recurring email:
http://support.microsoft.com/default.aspx?scid=kb;en-
us;239087

It works great, but now I want to also include an
attachment. I tried several things, such as
NewItem.Attachments.Add Source = "path" but get this
error:

"One or more parameter values are not valid" The
reference is to line 11 which is the line for the
attachment.
 
K

Ken Slovak - [MVP - Outlook]

You can just put the path there since it's the first argument in the
Add method.

If you want to use named arguments you have to use the correct syntax:
NewItem.Attachments.Add Source := "path"

Named arguments always have to use a colon followed by an equal sign.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
D

Duane Thomas

Here is my code. When I run the form, I get an error saying "Could not
complete the operation. One or more parameter values are not valid.
Line No:11"

Sub Item_PropertyChange(ByVal Name)
Select Case Name
Case "Status"
if Item.Status = 2 then '2 = Completed
Set NewItem = Application.CreateItem(0)
NewItem.To = "(e-mail address removed)"
NewItem.CC = "(e-mail address removed)"
NewItem.Recipients.ResolveAll
NewItem.Subject = "Team Meeting - Ops. 2 Dept. 3 Team 304"
NewItem.Body = "Attached is the agenda for Team 304's Team Meeting to be
held next Monday."
NewItem.Attachments.Add Source = "C:\Agenda.doc"
NewItem.Display
End IF
End Select
End Sub




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
K

Ken Slovak - [MVP - Outlook]

I just told you, your syntax is not correct.

Either lose the Source = and just put the path there or use the
correct syntax and use
Source := "C:\Agenda.doc" . You need the colon before the equal sign.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 

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