|
-
Sep 12th, 2005, 11:17 PM
#1
Thread Starter
New Member
Convert RPT to PDF and send it in email
Hi,
I want to convert my report to a pdf format and send it via email...I'm using the outlook application and i searched for codes to how to send email and got this code:
VB Code:
Dim mOutLookApp As Outlook.Application
Dim mNameSpace As Outlook.Namespace
Dim mItem As Outlook.MailItem
Set mOutLookApp = New Outlook.Application
Set mNameSpace = mOutLookApp.GetNamespace("MAPI")
mNameSpace.Logon , , False, True
Set mItem = mOutLookApp.CreateItem(olMailItem)
mItem.To = strEmailAddress
mItem.Subject = "This is for you"
mItem.HTMLBody = strMessage
mItem.Sensitivity = olConfidential
mItem.Importance = olImportanceHigh
mItem.Send
I got compile error in line one (mOutLookApp )that the user-defined type is not defined!!
How can i solve the problem?!!!
Please help me.
Last edited by RobDog888; Sep 12th, 2005 at 11:19 PM.
Reason: Added vbcode tags
-
Sep 12th, 2005, 11:19 PM
#2
Re: Convert RPT to PDF and send it in email
Welcome to the Forums. 
Add a reference to MS Outlook xx.0 Object Library
But as you stated, your doing this behind Outlook in VBA?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 13th, 2005, 02:15 PM
#3
Thread Starter
New Member
Re: Convert RPT to PDF and send it in email
hi,
how can i Add a reference to MS Outlook xx.0 Object Library?I don't wanna change the outlook cuz the ssytem will be based on a server.
My questions are:
1)How can i convert the report from rpt to pdf mode?
2)How can i send the report (use the outlook email as sender mail and a propmt box asking for reciever email)?
I hope you got the question right now
thanks
-
Sep 13th, 2005, 02:17 PM
#4
Re: Convert RPT to PDF and send it in email
Are you doing your coding in VB or Outlook VBA?
-
Sep 13th, 2005, 10:31 PM
#5
Thread Starter
New Member
Re: Convert RPT to PDF and send it in email
I'm doing the coding in VB6. Not the Outlook.
-
Sep 13th, 2005, 11:17 PM
#6
Re: Convert RPT to PDF and send it in email
What version of Outlook is on the server? If you add a reference to Outlook in you Project > Components > Controls tab > select "MS Outlook xx.0 Object Library" it will need to be the same version as on the server or you will need to use Late Binding to allow for the variation of Outlook versions.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 13th, 2005, 11:39 PM
#7
Re: Convert RPT to PDF and send it in email
Moved from Classic VB forum.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 14th, 2005, 03:53 AM
#8
Thread Starter
New Member
Re: Convert RPT to PDF and send it in email
Hi,
in:
Project > Components > Controls tab > I don't have "MS Outlook xx.0 Object Library" Instead i have "Microsoft Office Outlook View Control"
What shall i do?!
-
Sep 20th, 2005, 01:02 AM
#9
Thread Starter
New Member
Re: Convert RPT to PDF and send it in email
Now i can send the email but how can i send the report:
----------------------------
Dim olAppt As Outlook.AppointmentItem
Set olAppt = olApp.CreateItem(olAppointmentItem)
----------------------------
...I got an error in this line:
olAppt .Attachments = rptATMCardAppli
(the error msg is: Run Time Error '-2147352567(80020009) Property is read only)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|