PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Recurring message with attachment
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Recurring message with attachment
![]() |
Recurring message with attachment |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 "Duane Thomas" <duane.d.thomas@irs.gov> wrote in message news:056201c34110$bf690980$a501280a@phx.gbl... > 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. > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 = "duane.d.thomas@usa.gov" NewItem.CC = "todd.m.thomas@usa.gov" 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! |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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 "Duane Thomas" <anonymous@devdex.com> wrote in message news:OCtSb7WQDHA.2312@TK2MSFTNGP12.phx.gbl... > > 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 = "duane.d.thomas@usa.gov" > NewItem.CC = "todd.m.thomas@usa.gov" > 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! |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

