Print AND automatically send to file at same time

horhay_p

New Member
Joined
Jan 12, 2014
Messages
4
I would like to send a pdf to a file at the same time as I print. The file name should stay the same and just add .pdf at the end. My reasoning is for printing bills for my business. I would like to be able to go back and see the actual bill I sent out. I have already added the code to allow me to have the date modified and print date in the header and footer. This is helpful. I was wondering if there would be a code I could add to allow me send a duplicate pdf to a folder at the same time as I print. If you have a solution for me please remember that I already did add some code in case that changes your answer. Thanks!!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hello,

Welcome on-board!

Why not, after printing to PDF, do a FileCopy or CopyFile statement to, euhm, copy the generated file elsewhere?
 
Upvote 0
Hello,

Welcome on-board!

Why not, after printing to PDF, do a FileCopy or CopyFile statement to, euhm, copy the generated file elsewhere?


I just want to hit print and whatever prints I want to have saved, automatically, to a file in a specific "bills sent" folder. Is this possible with some code? And I don't want to open the file again because I have macros enabled to say when the file was modified and that would change it. This is why I want a PDF copy.
 
Upvote 0
Then, as said above, do the ExportAsFixedFormat, and after that, a CopyFile or FileCopy statement
(it depends on what you prefer, there is a VBA method and also a FileSriptingObject method).
These will not open up files in any way.
 
Upvote 0
Oh I guess I forgot to mention I don't write code haha. I am good at copy and pasting though. :LOL: So I need a function when print job is started to either print to file or save pdf to file. I could try to write the code myself but I'm guessing someone could do it in 1% of the time I could. thanks again for your responses. I am looking up code right now.
 
Upvote 0
This is what I am using so I know when I printed the invoice:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Application.ScreenUpdating = False
For Each wk In Worksheets
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = "&06 &F &A"
.CenterFooter = "&06 Last Modified on " & ActiveWorkbook.BuiltinDocumentProperties.Item("Last Save Time")
.RightFooter = "&06 Printed on &D &T"
End With
Next
Application.ScreenUpdating = True
End Sub

I just copied and modified someone else's code. I don't know how to write the code you mentioned above to send a pdf to a folder.
 
Upvote 0
I don't know how to write the code you mentioned above to send a pdf to a folder.

Did you look at ExportAsFixedFormat?
A Google search returns quite a number of hits.
 
Upvote 0
Also, can you please use
Code:
 tags when you paste code on the forum?Code tags format the code making it easier to read and hence follow the logic of the code.


You can use [CODE] tags in this way: 


Add the word [color=blue][b][PLAIN][code=rich][/PLAIN][/B][/color] before the first line of code, and
add the word [color=blue][b][PLAIN]
[/PLAIN][/B][/color] after the last line of code.


Or: you could use the "#" icon when changing / composing a message in the Advanced editing screen.


Thanks for your consideration.
 
Upvote 0

Forum statistics

Threads
1,215,731
Messages
6,126,539
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top