Code Comments
Programming Forum and web based access to our favorite programming groups.How can I add an attachment to this email using my code below. txtAttach.Tex
t
is populated with a file path. However it doesn't seem to be working.
I get an error that reads: 'Object doesn't support named arguments' Is
something wrong in the syntax or code?
Thanks,
Sean
********
' email
Dim App
Dim Item
Dim y As Integer
Dim sInFolder() As String
Attachment = txtAttach.Text
Set App = CreateObject("Outlook.Application")
Set Item = App.CreateItem(0)
With Item
.Subject =
.To =
.Cc =
.Body =
If chkAttach.Value = 1 And Len(Attachment > 20) Then
.Attachments.Add Source:=Attachment
End If
.Send
End With
Set App = Nothing
Set Item = Nothing
Post Follow-up to this messageWithout trying it remove the named argument and replace with something like this: .Attachments.Add Attachment -- Chris Hanscom - Microsoft MVP (VB) http://www.veign.com -- "Sean" <Sean@discussions.microsoft.com> wrote in message news:E9AD4503-F3E2-49E0-9C86-C7217016CA36@microsoft.com... > How can I add an attachment to this email using my code below. txtAttach.Text > is populated with a file path. However it doesn't seem to be working. > I get an error that reads: 'Object doesn't support named arguments' Is > something wrong in the syntax or code? > Thanks, > Sean > > ******** > > ' email > Dim App > Dim Item > Dim y As Integer > > Dim sInFolder() As String > Attachment = txtAttach.Text > Set App = CreateObject("Outlook.Application") > Set Item = App.CreateItem(0) > > With Item > .Subject = > .To = > .Cc = > .Body = > > If chkAttach.Value = 1 And Len(Attachment > 20) Then > .Attachments.Add Source:=Attachment > End If > > .Send > > End With > Set App = Nothing > Set Item = Nothing
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.