RE: Sending email from access - Reference Stephen Lebans code



Ups, sorry, having problems whit attachements, try this one

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
Set Attamm = myItem.attachments
myItem.to = "irshad2.gthe@xxxxxxxxxxxxx"
myItem.cc = "naaeems.gthe@xxxxxxxxxxxxx"
myItem.Subject = "Job-" & Me.JobNo & "-ClaimRef." & Me.ClaimRefNo.Value
myItem.body = "Reference is made to subject claim, attached pls. find
the claim form as pdf" + Chr(13) + "Thanks" + Chr(13) + "Irshad"
setnewAttacment = Attamm.Add("C:\WsImpFiles\MyClaimedPDF\" & "Job-" &
Me.JobNo & "-ClaimRef." & Me.ClaimRefNo.Value & ".PDF", olbyvalue)
myItem.Send




"Patricio" wrote:

Hope this help you
Sub SendingMail()

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
myItem.to = "irshad2.gthe@xxxxxxxxxxxxx"
myItem.cc = "naaeems.gthe@xxxxxxxxxxxxx"
myItem.Subject = "Job-" & Me.JobNo & "-ClaimRef." & Me.ClaimRefNo.Value
myItem.body = "Reference is made to subject claim, attached pls. find
the claim form as pdf" + Chr(13) + "Thanks" + Chr(13) + "Irshad"
myItem.Attach = "C:\WsImpFiles\MyClaimedPDF\" & "Job-" & Me.JobNo &
"-ClaimRef." & Me.ClaimRefNo.Value & ".PDF"
myItem.Send

End Sub

Regards

"Irshad Alam" wrote:

I have used the code and dll files after downloading from Mr. Stephen Lebans
website for converting the report to pdf (which have also dynapdf.dll &
strstorage.dll) . The following code I used which worked perfectly :

Private Sub Label59_Click()
RepoToPdfWC
End Sub

Function RepoToPdfWC()
Dim blRet As Boolean
blRet = ConvertReportToPDF(Me.Text60, vbNullString,
"C:\WsImpFiles\MyClaimedPDF\" & "Job-" & Me.JobNo & "-ClaimRef." &
Me.ClaimRefNo.Value & ".PDF", False)
End Function

Note : Me.Text60 contains the report name

The above sucessfully converts to pdf and open the pdf into acrobat 5

I want to add more codes and edit on above to get my below requirement

1 It should not open the acrobat for preview
2. it should open outlook express 6 - new email message and attach the above
created pdf and according to below BUT should not send, so that I can have a
final view before sending :

Email as below :

From: = mirshadalam@xxxxxxxxxxx
To: = irshad2.gthe@xxxxxxxxxxxxx
CC: = naaeems.gthe@xxxxxxxxxxxxx
Subject: = "Job-" & Me.JobNo & "-ClaimRef." & Me.ClaimRefNo.Value
Body = "Reference is made to subject claim, attached pls. find the claim
form as pdf"
Bodysecondline="Thanks"
Bodythirdline="Irshad"
AttachmentFile="C:\WsImpFiles\MyClaimedPDF\" & "Job-" & Me.JobNo &
"-ClaimRef." & Me.ClaimRefNo.Value & ".PDF"


Note2 : I am using Windows XP svcpack2 and outlook express 6 , ms office 2000

Please advice, it will help me to reduce job time of hours.

Regards

Irshad







.



Relevant Pages

  • RE: Sending email from access - Reference Stephen Lebans code
    ... Its is opening/making the mail in Ms Outlook, While I need the same to ... by sending the pdf by outlookexpress 6 with the complete coding. ... myItem.body = "Reference is made to subject claim, ... Sub SendingMail() ...
    (microsoft.public.access.modulesdaovba)
  • Re: Contact Items
    ... The scripts below is add a contactitem in your outlook2003,please reference ... "outlook application" first before you run it. ... Set myitem = olk.CreateItem ... End Sub ...
    (microsoft.public.outlook.program_vba)
  • RXParse module v.91 (by robic0)
    ... # Unicode character reference ... sub original_content ... then call content handler with $content ...
    (comp.lang.perl.misc)
  • Re: Emailing a Report
    ... make sure you have a reference to a Microsoft DAO Library ... The Sub LoopAgmtsSendEmail is highlighted by the Debugger. ... 'pSQL -- defines the recordset to open ... You must remember to enclose literal values in quotes and concatenate them; the final string must have commas too, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Shared Method Problem With "Global" Storage
    ... a routine in Module1 which then calls code back in Form1 ... ButtonHasBeenClicked but the reference to ButtonHasBeenClicked ... instance member of a class from within a shared method or shared ... In a shared Sub, you can not access an instance field withouth ...
    (microsoft.public.dotnet.languages.vb)