![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
If Not IsMissing(Attachment1Path) Then strDirPath = Dir(Attachment1Path) Do While strDirPath <> "" objMessage.AddAttachment strDirPath strDirPath = Dir() Loop End If You may want to check the total of all the file size before sending. |
#4
| |||
| |||
|
|
generates errormsg -21446697203 Unknown error ! my problem occures when the optinal parameter 'Attachment1Path' is missing ( not used) Filips "paii, Ron" <none (AT) no (DOT) com> wrote in message news:hg603j$abm$1 (AT) news (DOT) eternal-september.org... If Not IsMissing(Attachment1Path) Then strDirPath = Dir(Attachment1Path) Do While strDirPath <> "" objMessage.AddAttachment strDirPath strDirPath = Dir() Loop End If You may want to check the total of all the file size before sending. |
#5
| |||
| |||
|
|
I don't understand how a missing Attachement1Path parameter could cause an error. Both the code you supplied and I modified check that the parameter is supplied before attempting to add an attachment. The code I supplied also checks that the file exist before attempting to attach. Which line is causing the error? Note: strDirPath needs to be declared as type string in your function. "Filips Benoit" <benoit.filips (AT) telenet (DOT) be> wrote in message news:h%QVm.23998$wc4.20483 (AT) newsfe20 (DOT) ams2... generates errormsg -21446697203 Unknown error ! my problem occures when the optinal parameter 'Attachment1Path' is missing ( not used) Filips "paii, Ron" <none (AT) no (DOT) com> wrote in message news:hg603j$abm$1 (AT) news (DOT) eternal-september.org... If Not IsMissing(Attachment1Path) Then strDirPath = Dir(Attachment1Path) Do While strDirPath <> "" objMessage.AddAttachment strDirPath strDirPath = Dir() Loop End If You may want to check the total of all the file size before sending. |
#6
| |||
| |||
|
|
Hey, The error occures here: objMessage.AddAttachment strDirPath BUT without the Attachement1Path parameter it still enters the new code !!!!!!!!!!!! Filip "paii, Ron" <none (AT) no (DOT) com> wrote in message news:hg8rsg$6cl$1 (AT) news (DOT) eternal-september.org... I don't understand how a missing Attachement1Path parameter could cause an error. Both the code you supplied and I modified check that the parameter is supplied before attempting to add an attachment. The code I supplied also checks that the file exist before attempting to attach. Which line is causing the error? Note: strDirPath needs to be declared as type string in your function. "Filips Benoit" <benoit.filips (AT) telenet (DOT) be> wrote in message news:h%QVm.23998$wc4.20483 (AT) newsfe20 (DOT) ams2... generates errormsg -21446697203 Unknown error ! my problem occures when the optinal parameter 'Attachment1Path' is missing ( not used) Filips "paii, Ron" <none (AT) no (DOT) com> wrote in message news:hg603j$abm$1 (AT) news (DOT) eternal-september.org... If Not IsMissing(Attachment1Path) Then strDirPath = Dir(Attachment1Path) Do While strDirPath <> "" objMessage.AddAttachment strDirPath strDirPath = Dir() Loop End If You may want to check the total of all the file size before sending. |
#7
| |||
| |||
|
|
isMissing only works on Optional Variant types. Missing non Variant types are set to the default value for that type. String type default is a zero length string. Change your IF from isMissing(Attachment1Path) to Attachment1Path <> "". Sorry I don't use optional without defaults often and forgot about this bit with isMissing. "Filips Benoit" <benoit.filips (AT) telenet (DOT) be> wrote in message news:KFbWm.15386$RF5.12573 (AT) newsfe02 (DOT) ams2... Hey, The error occures here: objMessage.AddAttachment strDirPath BUT without the Attachement1Path parameter it still enters the new code !!!!!!!!!!!! Filip "paii, Ron" <none (AT) no (DOT) com> wrote in message news:hg8rsg$6cl$1 (AT) news (DOT) eternal-september.org... I don't understand how a missing Attachement1Path parameter could cause an error. Both the code you supplied and I modified check that the parameter is supplied before attempting to add an attachment. The code I supplied also checks that the file exist before attempting to attach. Which line is causing the error? Note: strDirPath needs to be declared as type string in your function. "Filips Benoit" <benoit.filips (AT) telenet (DOT) be> wrote in message news:h%QVm.23998$wc4.20483 (AT) newsfe20 (DOT) ams2... generates errormsg -21446697203 Unknown error ! my problem occures when the optinal parameter 'Attachment1Path' is missing ( not used) Filips "paii, Ron" <none (AT) no (DOT) com> wrote in message news:hg603j$abm$1 (AT) news (DOT) eternal-september.org... If Not IsMissing(Attachment1Path) Then strDirPath = Dir(Attachment1Path) Do While strDirPath <> "" objMessage.AddAttachment strDirPath strDirPath = Dir() Loop End If You may want to check the total of all the file size before sending. |
![]() |
| Thread Tools | |
| Display Modes | |
| |