Solved

Report as email attachement does not render report pictures

Posted on 2013-10-23
6
428 Views
Last Modified: 2013-10-23
Hello, when I print preview a report if the report contains pictures they display. However, if I use DoCmd.SendObject acReport, stDocName to attach the report to an email the pictures do not render on the report. The pictures are linked and not in the database. On the report I populate the images with the following code.


Why do the images appear when I print the report but not when the report is an attachment to an email?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
DefaultFilePath = GetDefaultFilePath
    If Me!txt_Picture1 > "" Then
    Me!Picture1.Picture = DefaultFilePath & Me!txt_Picture1
    End If
    If Me!txt_Picture2 > "" Then
    Me!Picture2.Picture = DefaultFilePath & Me!txt_Picture2
    End If
    If Me!txt_Picture3 > "" Then
    Me!Picture3.Picture = DefaultFilePath & Me!txt_Picture3
    End If
   
    
End Sub

Open in new window

0
Comment
Question by:gogetsome
  • 3
  • 3
6 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39594768
...and what is your entire SendObject code?

Perhaps the format you are using does not support images...?
0
 

Author Comment

by:gogetsome
ID: 39594815
Here is my code:
Private Sub btn_Supplier_Click()

On Error GoTo ErrorHandler

Dim emailList As String
Dim qdf As QueryDef
Dim rst As Recordset
Dim myPrice As Currency

Set qdf = CurrentDb.QueryDefs("Get_EmailDistributionListBySupplier")

qdf.Parameters(0) = Me.txt_Supplier.Value

Set rst = qdf.OpenRecordset

If rst.RecordCount > 0 Then

Do Until rst.EOF
   emailList = emailList & rst![email Address] & "; "
   rst.MoveNext
Loop

emailList = Left(emailList, Len(emailList) - 1)

Dim stDocName As String
stDocName = "DMR_Single View"
   
DoCmd.SendObject acReport, stDocName, , emailList

Else

  MsgBox "There are no email addresses in the database for this supplier."
  DoCmd.Hourglass False
  Resume ExitHandler
 
 End If
  
ExitHandler:
Set rs = Nothing
Set db = Nothing
Forms("DMR Tracking").Visible = True
Exit Sub

ErrorHandler:
Select Case Err
Case 2501
Resume ExitHandler
Case Else
Resume ExitHandler
End Select

End Sub

Open in new window

0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 39595108
Again, what output format are you specifying?
Because you left this argument blank in your code, it should popup and ask you for the format...
...In any even, when I select "PDF" as the output format, the images display fine in the resulting, attached PDF file...
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:gogetsome
ID: 39595186
You talking about the output format for the attachment?

Yes, a popup does ask a format type; however; pdf is not in the list (access 2003).

This

DoCmd.SendObject acReport, stDocName, pdf, emailList

still gives a popup for the type.

Am I lost here?
0
 

Author Closing Comment

by:gogetsome
ID: 39595409
Thank you boag2000 for the newb time! Since 2003 does not do PDF natively. We are going to force snapshot as the format.

This works perfectly:

DoCmd.SendObject acReport, stDocName, acFormatSNP, emailList
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39595537
oK great
;-)

BTW, what were you using before?
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now