473,478 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ACG Soft - "PDF & Mail Class Library" - Email PDF from Access 2k3

Hi,

I've been trying the PDF & Mail Class Library from ACG Soft
in combination with Northwind-2k3 style of db. Can someone help
me with the error which is popping up: (which I cant get solved..)

I'm trying to send a report in PDF-format with a unique QuotationID to
one specific customer by Email. >> Button in a form >> quotation-report
and a "filter and printfilter"- query..

MS Visual Basic Compile Error:
"Method or data member not found"
With the next line highlighted in the code:
.lngReturn = .Result
-------------Here is the code----------------
Private Sub Command33_Click()
On Error GoTo Err_Command33_Click

Dim objPDF As PDFClass
Dim objMail As MailClass
Dim strCurFileName As String

Dim strBaseFileLocation As String
Dim lngReturn As Long
Dim rsReports As Recordset '<- DAO recordset

'Comment out the line above and uncomment the two lines below when using
ADO in A2000 and 2002
'Dim conn As ADODB.Connection '<- ADO
'Dim rsReports As New ADODB.Recordset '<- ADO
Const MAIL_SYS_CDO = -1
Const RECIPIENT_TO = 1
Const PDFENGINE_WIN2PDF = 3
Set rsReports = CurrentDb.OpenRecordset("Select DISTINCT OfferteID,
emailadres from qryOfferteformGEN1PrintFILTER", dbOpenSnapshot) '<- DAO
recordset
'Comment out the line above and uncomment the two lines below when using
with ADO in A2000 and 2002
'Set conn = CurrentProject.Connection '<- ADO
'rsReports.Open "Select DISTINCT OfferteID, emailadres from
qryOfferteformGEN1PRINT", conn, adOpenStatic, adReadOnly '<- ADO
strBaseFileLocation = "C:\"
Set objPDF = New PDFClass
Set objMail = New MailClass

Do Until rsReports.EOF 'End of File

strCurFileName = strBaseFileLocation & "Orders For " &
rsReports!OfferteID & ".pdf"
With objPDF
.PDFEngine = PDFENGINE_WIN2PDF
.ReportName = "Offerte-per-Email"
.ReportWhere = "[OfferteID] = " & rsReports!OfferteID
.OutputFile = strCurFileName
.PrintImage
.lngReturn = .Result
End With

If lngReturn = True Then '<- PDF was output successfully
With objMail

..MsgSubject = "Current Invoice"
.MsgBodyText = "Attached is the current invoice for your
account in PDF format."
.RecipientAdd rsReports!KlantID, rsReports!emailadres, ,
RECIPIENT_TO, False
.AttachmentAdd strCurFileName, "Current Account Invoice.pdf"
.MsgSaveCopy = True
.SendMail MAIL_SYS_CDO
.RecipientsReset '<- get ready for the next mail item
.AttachmentsReset

End With
Else
MsgBox "Error!"
End If
rsReports.MoveNext
Loop

rsReports.Close
Set objPDF = Nothing
Set objMail = Nothing

Exit_Command33_Click:
Exit Sub

Err_Command33_Click:
MsgBox Err.Description
Resume Exit_Command33_Click

End Sub
-------------END of the code----------------

Whats wrong,... I've been trying, trying and trying...?!?
I heve been commenting out as well the ADO/DAO lines to 2000/2002,
then I get an error in "Dim conn As ADODB.Connection"..

(What my Access knowledge concerns, not a newbie, but have not much
VB programmskils either, more reading it a bit and cut&paste :-(
I'm using Access 2003 btw.

Hope someone can help me with this..

--
Regards
JvdWal

Nov 12 '05 #1
4 5511
JvdWal <Jv****@nospam.com> wrote in news:bp**********@news.cistron.nl:
Hi,

I've been trying the PDF & Mail Class Library from ACG Soft
in combination with Northwind-2k3 style of db. Can someone help
me with the error which is popping up: (which I cant get solved..)

I'm trying to send a report in PDF-format with a unique QuotationID to
one specific customer by Email. >> Button in a form >> quotation-report
and a "filter and printfilter"- query..

MS Visual Basic Compile Error:
"Method or data member not found"
With the next line highlighted in the code:
.lngReturn = .Result


lngReturn is a variable and not a member of objPDF.

So this may be more successful:

lngReturn = .Result
--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #2
Lyle Fairfield wrote:
JvdWal <Jv****@nospam.com> wrote in news:bp**********@news.cistron.nl:

Hi,

I've been trying the PDF & Mail Class Library from ACG Soft
in combination with Northwind-2k3 style of db. Can someone help
me with the error which is popping up: (which I cant get solved..)

I'm trying to send a report in PDF-format with a unique QuotationID to
one specific customer by Email. >> Button in a form >> quotation-report
and a "filter and printfilter"- query..

MS Visual Basic Compile Error:
"Method or data member not found"
With the next line highlighted in the code:
.lngReturn = .Result

lngReturn is a variable and not a member of objPDF.

So this may be more successful:

lngReturn = .Result


Hi, thanks for the quick reaction!

I changed the line into your suggestion: the tail of code is now like
this, but now with a highlighted compile error on ".MsgSubject":
- I kept the caption in the report empty, if it has something to do with
it..)
- configured Outlook to send the emails. (dont know if there support for
Mozilla.. ;-)

---------------tail of the code------------
strCurFileName = strBaseFileLocation & "Orders For " &
rsReports!OfferteID & ".pdf"
With objPDF
.PDFEngine = PDFENGINE_WIN2PDF
.ReportName = "Offerte-per-Email"
.ReportWhere = "[OfferteID] = " & rsReports!OfferteID
.OutputFile = strCurFileName
.PrintImage
lngReturn = .Result
End With

If lngReturn = True Then '<- PDF was output successfully
With objMail

..MsgSubject = "Current Invoice"
.MsgBodyText = "Attached is the current invoice for your
account in PDF format."
.RecipientAdd rsReports!KlantID, rsReports!emailadres, ,
RECIPIENT_TO, False
.AttachmentAdd strCurFileName, "Current Account Invoice.pdf"
.MsgSaveCopy = True
.SendMail MAIL_SYS_CDO
.RecipientsReset '<- get ready for the next mail item
.AttachmentsReset

End With
Else
MsgBox "Error!"
End If
rsReports.MoveNext
Loop

rsReports.Close
Set objPDF = Nothing
Set objMail = Nothing

Exit_Command33_Click:
Exit Sub

Err_Command33_Click:
MsgBox Err.Description
Resume Exit_Command33_Click

End Sub
---------------end code------------

--
Regards,
JvdWal

Nov 12 '05 #3
In Access 97 the requirement is .MsgSubjectText. See if that works.
Tony Gardner

JvdWal <Jv****@nospam.com> wrote in message news:<bp**********@news.cistron.nl>...
Lyle Fairfield wrote:
JvdWal <Jv****@nospam.com> wrote in news:bp**********@news.cistron.nl:

Hi,

I've been trying the PDF & Mail Class Library from ACG Soft
in combination with Northwind-2k3 style of db. Can someone help
me with the error which is popping up: (which I cant get solved..)

I'm trying to send a report in PDF-format with a unique QuotationID to
one specific customer by Email. >> Button in a form >> quotation-report
and a "filter and printfilter"- query..

MS Visual Basic Compile Error:
"Method or data member not found"
With the next line highlighted in the code:
.lngReturn = .Result

lngReturn is a variable and not a member of objPDF.

So this may be more successful:

lngReturn = .Result


Hi, thanks for the quick reaction!

I changed the line into your suggestion: the tail of code is now like
this, but now with a highlighted compile error on ".MsgSubject":
- I kept the caption in the report empty, if it has something to do with
it..)
- configured Outlook to send the emails. (dont know if there support for
Mozilla.. ;-)

---------------tail of the code------------
strCurFileName = strBaseFileLocation & "Orders For " &
rsReports!OfferteID & ".pdf"
With objPDF
.PDFEngine = PDFENGINE_WIN2PDF
.ReportName = "Offerte-per-Email"
.ReportWhere = "[OfferteID] = " & rsReports!OfferteID
.OutputFile = strCurFileName
.PrintImage
lngReturn = .Result
End With

If lngReturn = True Then '<- PDF was output successfully
With objMail

.MsgSubject = "Current Invoice"
.MsgBodyText = "Attached is the current invoice for your
account in PDF format."
.RecipientAdd rsReports!KlantID, rsReports!emailadres, ,
RECIPIENT_TO, False
.AttachmentAdd strCurFileName, "Current Account Invoice.pdf"
.MsgSaveCopy = True
.SendMail MAIL_SYS_CDO
.RecipientsReset '<- get ready for the next mail item
.AttachmentsReset

End With
Else
MsgBox "Error!"
End If
rsReports.MoveNext
Loop

rsReports.Close
Set objPDF = Nothing
Set objMail = Nothing

Exit_Command33_Click:
Exit Sub

Err_Command33_Click:
MsgBox Err.Description
Resume Exit_Command33_Click

End Sub
---------------end code------------

Nov 12 '05 #4
Tony Gardner wrote:
In Access 97 the requirement is .MsgSubjectText. See if that works.
Tony Gardner


Hi,

Its working now, with this one and some other small changes..
Tnx!

--
Regards
JvdWal

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2469
by: Jian H. Li | last post by:
Hello, What's the essential differences between the two ways of "class::member" & "object.member"(or object_pointer->member)? class C{ public: void f() {} int i; };
4
14758
by: barney | last post by:
Hello, I' m using .NET System.Xml.XmlDOcument. When I do the following: XmlDocument xml = new XmlDocument(); xml.Load("blah"); .... xml.Save("blub"); I've got the problem that the following...
2
1622
by: George Sew | last post by:
Hi there, When you right-click on a pdf file in Windows, you can visualize the "Title" and the "Comments" fields under the "Summary" tab. I am trying to retrieve these fields so that I can put...
5
3421
by: martin | last post by:
Hi, I would be extremly grateful for some help on producing an xml fragemt. The fragment that I wish to produce should look like this <Addresses> <Address>&qout;Somebody's Name&quot;...
5
6458
by: David Lozzi | last post by:
Hello, this is a repost of a previous post of mine from today. I need to export multiple documents (doc, xls, ppt, jpg) and crystal reports to a single PDF file. I know how to export a single...
3
11879
by: pw | last post by:
Hi, I created and distributed an Access 2003 MDE. When the user opens up a form he get's an error message :Function is not available in expressions in query expression 'Trim( & ", " & )'. ...
3
2267
by: nadeem_far | last post by:
Hello All, I have a couple of questions and I am not able to find them any where on internet. 1. We are using a third party class library which exposes a class with the name of "class". ...
2
1614
by: Kuldeep | last post by:
Framework: Visual Studio 2005 Technology: ASP.NET 2.0 Language: C#.NET 2.0 Hi All, I have an in-built tool to generate PDF Reports. Once a PDF Report is generated, I have provided an option...
30
3783
by: Medvedev | last post by:
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at...
0
7019
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7067
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6719
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5312
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4463
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2980
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2970
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
555
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.