A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Problem with filling in Attachments



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 30th 06, 11:11 AM posted to microsoft.public.outlook.program_vba
Sascha Lengen
external usenet poster
 
Posts: 2
Default 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


  #2  
Old May 30th 06, 01:17 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default 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


  #3  
Old May 30th 06, 02:04 PM posted to microsoft.public.outlook.program_vba
Sascha Lengen
external usenet poster
 
Posts: 2
Default 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




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with attachments Tomasz Grobelny Outlook Express 1 April 27th 06 10:06 PM
Problem with Outlook and attachments [email protected] Outlook - General Queries 2 April 27th 06 04:15 PM
Problem opening attachments Kevin Outlook - Installation 2 February 15th 06 08:41 PM
Filling an email with html John Outlook - General Queries 3 January 16th 06 03:39 PM
Filling an email with html John Outlook and VBA 2 January 16th 06 03:39 PM


All times are GMT +1. The time now is 08:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.