Recurring message with attachment

  • Thread starter Thread starter Duane Thomas
  • Start date Start date
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.
 
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
 
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
 
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
 
Back
Top