Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Problem with filling in Attachments (http://www.outlookbanter.com/outlook-vba/16244-problem-filling-attachments.html)

Sascha Lengen May 30th 06 11:11 AM

Problem with filling in Attachments
 

Hello NG,

I want to automatically open an TemplateFile (*.oft) an fill in the Subject
an some Attachments.
The template is opening fine and the Subject is correct too.
I get the following error when I fill in the attachments: Error # 446: No
named arguments; In Line: 1

Can someone help me fix this problem?

Thans
Sascha


'##### Start Mailtemplate
Process.Start(oftDoku)

'##### Declarations
Dim olApp As Object
olApp = CreateObject("Outlook.Application")
Dim olInsp As Object
Dim olMail As Object
Dim olAtt As Object

olInsp = olApp.ActiveInspector
olMail = olInsp.CurrentItem
olAtt = olMail.Attachments

'##### Extend Subject
If Not TypeName(olMail) = "Nothing" Then
olMail.Subject = olMail.Subject & " - Projekt-Nr. " & getPrj
End If

'##### Fill-In Attachments from ListView
Dim i As Integer

With ListView1
For i = 0 To .Items.Count - 1
If .Items(i).Checked Then
1: olAtt.Add(Source:=DocPfad & .Items.Item(i).SubItems(2).Text)
End If
Next i
End With

End



Sue Mosher [MVP-Outlook] May 30th 06 01:17 PM

Problem with filling in Attachments
 
The error tells you not to use named arguments:

olAtt.Add(DocPfad & .Items.Item(i).SubItems(2).Text)

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Sascha Lengen" wrote in message ...

Hello NG,

I want to automatically open an TemplateFile (*.oft) an fill in the Subject
an some Attachments.
The template is opening fine and the Subject is correct too.
I get the following error when I fill in the attachments: Error # 446: No
named arguments; In Line: 1

Can someone help me fix this problem?

Thans
Sascha


'##### Start Mailtemplate
Process.Start(oftDoku)

'##### Declarations
Dim olApp As Object
olApp = CreateObject("Outlook.Application")
Dim olInsp As Object
Dim olMail As Object
Dim olAtt As Object

olInsp = olApp.ActiveInspector
olMail = olInsp.CurrentItem
olAtt = olMail.Attachments

'##### Extend Subject
If Not TypeName(olMail) = "Nothing" Then
olMail.Subject = olMail.Subject & " - Projekt-Nr. " & getPrj
End If

'##### Fill-In Attachments from ListView
Dim i As Integer

With ListView1
For i = 0 To .Items.Count - 1
If .Items(i).Checked Then
1: olAtt.Add(Source:=DocPfad & ..Items.Item(i).SubItems(2).Text)
End If
Next i
End With

End



Sascha Lengen May 30th 06 02:04 PM

Problem with filling in Attachments
 
Thank you Sue,

I was so blind and
my english is really not perfect (I'm german).


"Sue Mosher [MVP-Outlook]" schrieb im Newsbeitrag
...
The error tells you not to use named arguments:

olAtt.Add(DocPfad & .Items.Item(i).SubItems(2).Text)

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Sascha Lengen" wrote in message
...

Hello NG,

I want to automatically open an TemplateFile (*.oft) an fill in the
Subject
an some Attachments.
The template is opening fine and the Subject is correct too.
I get the following error when I fill in the attachments: Error # 446: No
named arguments; In Line: 1

Can someone help me fix this problem?

Thans
Sascha


'##### Start Mailtemplate
Process.Start(oftDoku)

'##### Declarations
Dim olApp As Object
olApp = CreateObject("Outlook.Application")
Dim olInsp As Object
Dim olMail As Object
Dim olAtt As Object

olInsp = olApp.ActiveInspector
olMail = olInsp.CurrentItem
olAtt = olMail.Attachments

'##### Extend Subject
If Not TypeName(olMail) = "Nothing" Then
olMail.Subject = olMail.Subject & " - Projekt-Nr. " & getPrj
End If

'##### Fill-In Attachments from ListView
Dim i As Integer

With ListView1
For i = 0 To .Items.Count - 1
If .Items(i).Checked Then
1: olAtt.Add(Source:=DocPfad & .Items.Item(i).SubItems(2).Text)
End If
Next i
End With

End






All times are GMT +1. The time now is 08:18 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com