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

Tags: , ,

One or more parameters could not be found





 
 
Thread Tools Display Modes
  #1  
Old June 19th 06, 04:17 AM posted to microsoft.public.outlook.program_vba
Tim
external usenet poster
 
Posts: 124
Default One or more parameters could not be found

Hi There,

I am automating the creation of emails in Excel VBA. The code works fine
for most situations but on two PCs throws the error: One or more parameters
could not be found. Has anyone had this problem?

many thanks

Tim


Ads
  #2  
Old June 19th 06, 06:19 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default One or more parameters could not be found

Am Sun, 18 Jun 2006 19:17:01 -0700 schrieb Tim:

Please show the code and the error causing line.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Hi There,

I am automating the creation of emails in Excel VBA. The code works fine
for most situations but on two PCs throws the error: One or more

parameters
could not be found. Has anyone had this problem?

many thanks

Tim

  #3  
Old June 19th 06, 07:07 AM posted to microsoft.public.outlook.program_vba
Tim
external usenet poster
 
Posts: 124
Default One or more parameters could not be found

Thanks Michael.

After the email is displayed (correctly) the user clicks send and gets the
error "This message could not be sent. One or more parameters could not be
found"

Code as follows:


Public Sub SendMailOutlook(aTo, Subject, TextBody, aFrom, cc, strFile,
Optional strTemplate = "")

Dim Message As Outlook.MailItem
On Error GoTo 0
Const olOriginator = 0

'Create new message
If strTemplate = "" Then
Set Message = Outlook.CreateItemFromTemplate(GC_TEMPLATE_FOLDER &
"Template.oft")
Else
Set Message = Outlook.CreateItemFromTemplate(GC_TEMPLATE_FOLDER &
"Rostering Confirmation Template.oft")
End If

With Message

'Set destination email address
.Recipients.Add (aTo)
.Subject = Subject
.cc = cc

'Set sender address If specified.
If Len(aFrom) 0 Then .Recipients.Add(aFrom).Type = olOriginator
.Attachments.Add strFile

.Display

End With

End Sub



"Tim" wrote:

Hi There,

I am automating the creation of emails in Excel VBA. The code works fine
for most situations but on two PCs throws the error: One or more parameters
could not be found. Has anyone had this problem?

many thanks

Tim


  #4  
Old June 20th 06, 06:32 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default One or more parameters could not be found

Am Sun, 18 Jun 2006 22:07:01 -0700 schrieb Tim:

Tim, what happens if you´re using the Recipients collection for all
addresses and call Recipients.ResoveAll?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Thanks Michael.

After the email is displayed (correctly) the user clicks send and gets the
error "This message could not be sent. One or more parameters could not be
found"

Code as follows:


Public Sub SendMailOutlook(aTo, Subject, TextBody, aFrom, cc, strFile,
Optional strTemplate = "")

Dim Message As Outlook.MailItem
On Error GoTo 0
Const olOriginator = 0

'Create new message
If strTemplate = "" Then
Set Message = Outlook.CreateItemFromTemplate(GC_TEMPLATE_FOLDER &
"Template.oft")
Else
Set Message = Outlook.CreateItemFromTemplate(GC_TEMPLATE_FOLDER &
"Rostering Confirmation Template.oft")
End If

With Message

'Set destination email address
.Recipients.Add (aTo)
.Subject = Subject
.cc = cc

'Set sender address If specified.
If Len(aFrom) 0 Then .Recipients.Add(aFrom).Type = olOriginator
.Attachments.Add strFile

.Display

End With

End Sub



"Tim" wrote:

Hi There,

I am automating the creation of emails in Excel VBA. The code works fine
for most situations but on two PCs throws the error: One or more

parameters
could not be found. Has anyone had this problem?

many thanks

Tim


 




Thread Tools
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
Creating email with parameters Jeppe Jespersen Outlook - General Queries 0 May 18th 06 10:27 AM
Cannot save new contact; invalid parameters ClaireQ87 Outlook - General Queries 3 May 14th 06 09:37 PM
How do I change password/login parameters? Bruce Outlook Express 1 May 4th 06 12:55 AM
How do I pass parameters to application invoked by Outlook rule? Sergy Stouk Outlook - Installation 1 March 20th 06 01:18 PM
Parameters not valid Suedra Outlook - Calandaring 0 February 24th 06 01:57 AM


All times are GMT +1. The time now is 03:55 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Internet Advertising - Myspace Layouts - Internet Advertising - Online Loans - Online Loans