Close Acrobat Reader from access

G

Guest

I am using the code below to fax a PDF from Access. This all works fine
except that it leaves Acrobat Reader open after it has finished. Could
someone please advise what I need to add to close Acrobat Reader.


Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.Mailitem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

Dim stDocName As String

stDocName = "Delivery Notification - PrintPDF"
DoCmd.RunMacro stDocName

With objEmail
.To = "[fax:" & Me![Fax1] & "]"
.Attachments.Add "C:\SendPDF\Delivery Notification - All Up PDF.pdf":
.Send
End With


Thanks in advance.
 
J

John Nurick

Hi Shannon,

The only thing in your code that looks as if could possibly cause
Acrobat Reader to open is the macro "Delivery Notification - PrintPDF"
which presumably prints a report or something to a PDF file.

I guess that whatever software the macro uses to create the PDF file
(probably a printer driver) is set to automatically display a PDF after
creating it (hence launching Acrobat Reader). So you need to find and
disable that setting.

I am using the code below to fax a PDF from Access. This all works fine
except that it leaves Acrobat Reader open after it has finished. Could
someone please advise what I need to add to close Acrobat Reader.


Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.Mailitem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

Dim stDocName As String

stDocName = "Delivery Notification - PrintPDF"
DoCmd.RunMacro stDocName

With objEmail
.To = "[fax:" & Me![Fax1] & "]"
.Attachments.Add "C:\SendPDF\Delivery Notification - All Up PDF.pdf":
.Send
End With


Thanks in advance.
 
G

Guest

Thanks John,

I have checked the setting for the pdf printer and it is set to not show the
PDF after creating it. I have also tried running the code without creating
the PDF - just using an existing PDF and the Acrobat window is still left
open after it is faxed.

John Nurick said:
Hi Shannon,

The only thing in your code that looks as if could possibly cause
Acrobat Reader to open is the macro "Delivery Notification - PrintPDF"
which presumably prints a report or something to a PDF file.

I guess that whatever software the macro uses to create the PDF file
(probably a printer driver) is set to automatically display a PDF after
creating it (hence launching Acrobat Reader). So you need to find and
disable that setting.

I am using the code below to fax a PDF from Access. This all works fine
except that it leaves Acrobat Reader open after it has finished. Could
someone please advise what I need to add to close Acrobat Reader.


Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.Mailitem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

Dim stDocName As String

stDocName = "Delivery Notification - PrintPDF"
DoCmd.RunMacro stDocName

With objEmail
.To = "[fax:" & Me![Fax1] & "]"
.Attachments.Add "C:\SendPDF\Delivery Notification - All Up PDF.pdf":
.Send
End With


Thanks in advance.
 
J

John Nurick

In that case I guess it's something to do with your fax software - but I
don't have any suggestions.

Thanks John,

I have checked the setting for the pdf printer and it is set to not show the
PDF after creating it. I have also tried running the code without creating
the PDF - just using an existing PDF and the Acrobat window is still left
open after it is faxed.

John Nurick said:
Hi Shannon,

The only thing in your code that looks as if could possibly cause
Acrobat Reader to open is the macro "Delivery Notification - PrintPDF"
which presumably prints a report or something to a PDF file.

I guess that whatever software the macro uses to create the PDF file
(probably a printer driver) is set to automatically display a PDF after
creating it (hence launching Acrobat Reader). So you need to find and
disable that setting.

I am using the code below to fax a PDF from Access. This all works fine
except that it leaves Acrobat Reader open after it has finished. Could
someone please advise what I need to add to close Acrobat Reader.


Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.Mailitem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

Dim stDocName As String

stDocName = "Delivery Notification - PrintPDF"
DoCmd.RunMacro stDocName

With objEmail
.To = "[fax:" & Me![Fax1] & "]"
.Attachments.Add "C:\SendPDF\Delivery Notification - All Up PDF.pdf":
.Send
End With


Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top