From: Gene. on
Hello gurus

i am using MAPI.Session object to construct mail with attachments.
Here is a line which produces error:

objAttachment1 = RepOneMessageAttachments.Add("ex.rc", , CdoFileData,
"h:\ex.rc")

.... and error:

C:\vb\t7.vbs(50, 1) Collaboration Data Objects: [Collaboratio
n Data Objects - [E_INVALIDARG(80070057)]]

If I run something different:

Set objAttachment1 = RepOneMessageAttachments.Add

With objAttachment1
.Type = CdoFileData
.Position = 0 ' render at first character of message
.Name = "h:\ex.rc"
.ReadFromFile "h:\ex.rc"
End With

.... I am getting:

C:\vb\t7.vbs(57, 13) Microsoft VBScript runtime error: Named a
rgument not found: 'Type'

.... and

if I comment out 'Type,

I am getting mail, but attachment is called some weird name.

Can somebody help me how should I resolve it.
From: Pegasus [MVP] on


"Gene." <Gene(a)discussions.microsoft.com> wrote in message
news:E57D2878-20CE-4F3B-9E86-8C3A154A20A3(a)microsoft.com...
> Hello gurus
>
> i am using MAPI.Session object to construct mail with attachments.
> Here is a line which produces error:
>
> objAttachment1 = RepOneMessageAttachments.Add("ex.rc", , CdoFileData,
> "h:\ex.rc")
>
> ... and error:
>
> C:\vb\t7.vbs(50, 1) Collaboration Data Objects: [Collaboratio
> n Data Objects - [E_INVALIDARG(80070057)]]
>
> If I run something different:
>
> Set objAttachment1 = RepOneMessageAttachments.Add
>
> With objAttachment1
> .Type = CdoFileData
> .Position = 0 ' render at first character of message
> .Name = "h:\ex.rc"
> .ReadFromFile "h:\ex.rc"
> End With
>
> ... I am getting:
>
> C:\vb\t7.vbs(57, 13) Microsoft VBScript runtime error: Named a
> rgument not found: 'Type'
>
> ... and
>
> if I comment out 'Type,
>
> I am getting mail, but attachment is called some weird name.
>
> Can somebody help me how should I resolve it.

Why not use the process from your other thread?

From: Gene. on
Sorry which process from which thread?

"Pegasus [MVP]" wrote:

>
>
> "Gene." <Gene(a)discussions.microsoft.com> wrote in message
> news:E57D2878-20CE-4F3B-9E86-8C3A154A20A3(a)microsoft.com...
> > Hello gurus
> >
> > i am using MAPI.Session object to construct mail with attachments.
> > Here is a line which produces error:
> >
> > objAttachment1 = RepOneMessageAttachments.Add("ex.rc", , CdoFileData,
> > "h:\ex.rc")
> >
> > ... and error:
> >
> > C:\vb\t7.vbs(50, 1) Collaboration Data Objects: [Collaboratio
> > n Data Objects - [E_INVALIDARG(80070057)]]
> >
> > If I run something different:
> >
> > Set objAttachment1 = RepOneMessageAttachments.Add
> >
> > With objAttachment1
> > .Type = CdoFileData
> > .Position = 0 ' render at first character of message
> > .Name = "h:\ex.rc"
> > .ReadFromFile "h:\ex.rc"
> > End With
> >
> > ... I am getting:
> >
> > C:\vb\t7.vbs(57, 13) Microsoft VBScript runtime error: Named a
> > rgument not found: 'Type'
> >
> > ... and
> >
> > if I comment out 'Type,
> >
> > I am getting mail, but attachment is called some weird name.
> >
> > Can somebody help me how should I resolve it.
>
> Why not use the process from your other thread?
>
> .
>
From: Pegasus [MVP] on


"Gene." <Gene(a)discussions.microsoft.com> wrote in message
news:C426B8D6-6495-44FB-B022-DBED30148C8C(a)microsoft.com...
> Sorry which process from which thread?

The one you posted in this newsgroup three days ago under the heading
"Cannot send mail from VB Scripts". You replied "All works now.
It had to specify different mail server - not the one I had in a profile.".
Remember?


From: Gene. on
It is a different issue now if you noticed.
Please let me know if you could help with this issue. I am at the end of the
task and problem with cumbersome attachments may negate whole effort.

"Pegasus [MVP]" wrote:

>
>
> "Gene." <Gene(a)discussions.microsoft.com> wrote in message
> news:C426B8D6-6495-44FB-B022-DBED30148C8C(a)microsoft.com...
> > Sorry which process from which thread?
>
> The one you posted in this newsgroup three days ago under the heading
> "Cannot send mail from VB Scripts". You replied "All works now.
> It had to specify different mail server - not the one I had in a profile.".
> Remember?
>
>
> .
>