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

One or more parameters could not be found



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


All times are GMT +1. The time now is 03:57 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.