473,762 Members | 6,675 Online
Bytes | Software Development & Data Engineering Community
+ 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_C lick

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

Dim strBaseFileLoca tion 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.Connectio n '<- ADO
'Dim rsReports As New ADODB.Recordset '<- ADO
Const MAIL_SYS_CDO = -1
Const RECIPIENT_TO = 1
Const PDFENGINE_WIN2P DF = 3
Set rsReports = CurrentDb.OpenR ecordset("Selec t DISTINCT OfferteID,
emailadres from qryOfferteformG EN1PrintFILTER" , 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
qryOfferteformG EN1PRINT", conn, adOpenStatic, adReadOnly '<- ADO
strBaseFileLoca tion = "C:\"
Set objPDF = New PDFClass
Set objMail = New MailClass

Do Until rsReports.EOF 'End of File

strCurFileName = strBaseFileLoca tion & "Orders For " &
rsReports!Offer teID & ".pdf"
With objPDF
.PDFEngine = PDFENGINE_WIN2P DF
.ReportName = "Offerte-per-Email"
.ReportWhere = "[OfferteID] = " & rsReports!Offer teID
.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!Klant ID, rsReports!email adres, ,
RECIPIENT_TO, False
.AttachmentAdd strCurFileName, "Current Account Invoice.pdf"
.MsgSaveCopy = True
.SendMail MAIL_SYS_CDO
.RecipientsRese t '<- get ready for the next mail item
.AttachmentsRes et

End With
Else
MsgBox "Error!"
End If
rsReports.MoveN ext
Loop

rsReports.Close
Set objPDF = Nothing
Set objMail = Nothing

Exit_Command33_ Click:
Exit Sub

Err_Command33_C lick:
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.Connectio n"..

(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 5533
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 ".MsgSubjec t":
- 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 = strBaseFileLoca tion & "Orders For " &
rsReports!Offer teID & ".pdf"
With objPDF
.PDFEngine = PDFENGINE_WIN2P DF
.ReportName = "Offerte-per-Email"
.ReportWhere = "[OfferteID] = " & rsReports!Offer teID
.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!Klant ID, rsReports!email adres, ,
RECIPIENT_TO, False
.AttachmentAdd strCurFileName, "Current Account Invoice.pdf"
.MsgSaveCopy = True
.SendMail MAIL_SYS_CDO
.RecipientsRese t '<- get ready for the next mail item
.AttachmentsRes et

End With
Else
MsgBox "Error!"
End If
rsReports.MoveN ext
Loop

rsReports.Close
Set objPDF = Nothing
Set objMail = Nothing

Exit_Command33_ Click:
Exit Sub

Err_Command33_C lick:
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.cistro n.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 ".MsgSubjec t":
- 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 = strBaseFileLoca tion & "Orders For " &
rsReports!Offer teID & ".pdf"
With objPDF
.PDFEngine = PDFENGINE_WIN2P DF
.ReportName = "Offerte-per-Email"
.ReportWhere = "[OfferteID] = " & rsReports!Offer teID
.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!Klant ID, rsReports!email adres, ,
RECIPIENT_TO, False
.AttachmentAdd strCurFileName, "Current Account Invoice.pdf"
.MsgSaveCopy = True
.SendMail MAIL_SYS_CDO
.RecipientsRese t '<- get ready for the next mail item
.AttachmentsRes et

End With
Else
MsgBox "Error!"
End If
rsReports.MoveN ext
Loop

rsReports.Close
Set objPDF = Nothing
Set objMail = Nothing

Exit_Command33_ Click:
Exit Sub

Err_Command33_C lick:
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
2496
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
14802
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 expression: .... snip ...
2
1634
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 them in a DataGrid. Unfortunately, the fileinfo class does not provide this information. Is there another class I can use? Any help would really be appreciated! Thanks!
5
3447
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; &lt;me@mydomain.com&gt;</Address> </Addresses>
5
6480
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 Crystal Report to PDF and it works quite nicely using the Response.ContentType = "application/pdf". However, the users have an option to include other documents/reports in their report that are associated with the report. For example: User previews a...
3
11901
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( & ", " & )'. It works fine at other clients. How can I resolve this? I do not see anything in the MS KB.
3
2281
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". Now how can i create an object of this "class" class as class is a reserve word in C#.
2
1621
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 of "Viewing" the PDF as well. Now, once there is a large PDF being generated (say a PDF of 70 Pages or so)
30
3844
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 the end of the app for example: class test { public: int x;
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10136
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6640
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5266
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3913
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 we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.