PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Recurring message with attachment

Reply

Recurring message with attachment

 
Thread Tools Rate Thread
Old 03-07-2003, 05:11 AM   #1
Duane Thomas
Guest
 
Posts: n/a
Default Recurring message with attachment


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.

  Reply With Quote
Old 03-07-2003, 03:50 PM   #2
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: Recurring message with 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


"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.
>



  Reply With Quote
Old 03-07-2003, 04:24 PM   #3
Duane Thomas
Guest
 
Posts: n/a
Default Re: Recurring message with attachment


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!
  Reply With Quote
Old 03-07-2003, 04:38 PM   #4
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: Recurring message with attachment

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!



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off