I have a strange one. I am using the datatype DECIMAL in my SQL table. like this:
DebtAmount DECIMAL(17,2) NULL
If I insert values like: 100 or 10.5 or -10 they insert no problem.
The problem I am having is loads of my data has negative values that have it like 200- or 350- (you see the minus...
so as you can see the items in column C are the pdf items for attaching to the email. but sometimes there may not exist this pdf item. so when I run my vb code at the moment it stops when there is no matching pdf item in the folder to attach - I need the code to ignore\don't send that person an...
yeah its really for a situation where there is no pdf for a person on the excel list in the folder - but there may be the next time the mailshot takes place.
ok Combo thanks for the advice - this is all a learning curve for me.
in terms of the IF.....can I say if the item (pdf in this case) in column C does not exist in the directory specified to continue onto the next row?
perfect!!! i am almost there - just testing it now. would i need an if statement somewhere in the loop - as if the attachment does not exist the code falls over. so if the 2nd person on the list has a pdf to go to them and there is no pdf can that persons email be skipped?
Combo that's exactly what I was after!!! thank you. now I just have to figure out how to get this code to send straight away or [ut into outbox....ill investigate this now i have made some progress.
thanks all for help so far
ok so I have tidied the code up a bit now:
Sub Single_attachment()
Dim appOutlook As Object
Dim Email As Object
Dim Source, mailto As String
Dim intR As Integer
Set appOutlook = CreateObject("Outlook.Application")
Set Email = appOutlook.CreateItem(olMailItem)
intR = 2
For intR = 2 To 6
If...
Hi,
I am trying to run a VB script that generates email with doc attached. I have the script below but inly generates one email - I have 5 rows on my source excel doc. the script below does what i want but only creates one email with the attachment.
Any help here would be great.
Sub...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.