PDF images

Does your code compile? Does it run without error? Step through it line by line.

Also to make the Outlook instance visible, add the line
Code:
appOutLook.visible = true
after creating appOutlook
 
This what I have now. Still, nothing happens. Outlook does not come up...

Private Sub Command93_Click()
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
DoCmd.OutputTo acOutputReport, , acFormatPDF, "C:\aaa\" & [Msampleid] & ".pdf"
MsgBox "PDF Saved To Safe Air Systems As " & [Msampleid] & ".pdf"
Me.Caption = Me.Msampleid
With MailOutLook
.To = "test@test.com"
' .cc = ""
' .bcc = ""
.Attachments.Add "c:\aaa\9890.pdf"
.Subject = "Test"
.HTMLBody = "Test HL: <a href='folder path here'>Link description here</a>"
' .Send
End With
End Sub
 
Got it to work. How can I make Outlook popup without sending automatically. This sent it without me seeing the Outlook dialog.
 
.Send is commented so it should not send automatically.
 
Try .Display instead of .Send
I'm presuming when you say fixed it, your code in post 22 no longer applies.
 
Ok, when .send is uncommented, it sends automatically. When it is commented ' .send, nothing happens or pops up.
 
Ooops, my bad. I left that line out of example in other thread. Just edited to add. Glad you got it working.
 
Thanks! Going to do a little tweaking now. Wish me luck.
 
How do I make .HTMLBody = "Test HL: <a href='folder path here'>Link description here</a>
multiple lines in the body. Meaning, how can I create more than one line? Not sure of the format.

Thanks...
 
Code:
.HTMLBody = "Test HL: <a href='folder path here'>Link description here</a>" & _
    "<br>Second line" & _
    "<br>Third line"

or
Code:
dim strHTML as string
strHTML = "Test HL: <a href='folder path here'>Link description here</a>"
strHTML = strHTML & "<br>Second line"
strHTML = strHTML & "<br>Third line"
 
HTMLBody allows using HTML code tags to apply special formatting (underscore, bold, color, font) to text as well as the clickable URL link. If you just want simple text:

.Body = "My text here" & vbCrLf & "more text" & vbCrLf & "and more text"
 
I am not sure if this has been touched on. When access produces a pdf, it uses the current default printer. It's worth checking that the default printer makes sense. Try a different printer, and see if it uses a different font.

At the very least, try the "MicroSoft print to PDF", and see if that works.

You would need to (effectively) set the current printer to ""MicroSoft print to PDF" to prepare the pdf, then set the current printer back to nothing after producing the pdf, which actually just restores the active printer to the default.
 
Last edited:
No printer is used when SendObject or OutputTo PDF is used. That wouldn't make sense. It is no different than choosing Save As in MS Word and saving as type .PDF.
 
@zeroaccess - are you certain that OutputTo PDF doesn't look at the printer? As an experiment, try changing the selected printer before doing that. In the past that HAS been shown to have an effect. If the latest version of Access has fixed that, all I can say is "Hooray!" because it has vexed many folks for years.
 
@zeroaccess - are you certain that OutputTo PDF doesn't look at the printer? As an experiment, try changing the selected printer before doing that. In the past that HAS been shown to have an effect. If the latest version of Access has fixed that, all I can say is "Hooray!" because it has vexed many folks for years.
What would I notice if it did? Would I get an error?
 
Difference in resolution of the images.
 
Ok. What other printer should I change to to test this? A real printer, or a software "printer"?

Also, it needs to be noted that I have shown that the Output Quality setting of DoCmd.OutputTo exactly mirrors the effect of saving a .PDF with the "High Quality" (acExportQualityPrint) vs "E-Mail" (acExportQualityScreen) presets when doing a Save As in Word or Excel. And, the output of acExportQualityScreen is identical to what you get when using DoCmd.SendObject.

In other words:
SQL:
    DoCmd.OutputTo , , acFormatPDF, , , , , acExportQualityPrint
Is the same as Saving As a High Quality PDF from other Office Suite applications. And,

SQL:
    DoCmd.OutputTo , , acFormatPDF, , , , , acExportQualityScreen
    DoCmd.SendObject , , acFormatPDF
Give the same output as an Email quality PDF from other Office Suite applications.
 
Last edited:
If you are satisfied that a high-quality export works, then it is obvious that what used to be a really ugly situation has been addressed. In that case it becomes immaterial. I can only tell you that back in the AC97 days, this was a problem. But back then, I don't recall "acFormatPDF" was available either. So if you don't feel the need to test, I don't either.
 

Users who are viewing this thread

Back
Top Bottom