Word XP, Acrobat 7.08
Am trying to convert the active Word document to pdf in my macro. After conversion I want to copy the pdf that was made to a different directory. The pdf maker window pops up and it starts to convert. The progress bar stops part way through and a vba error pops up stating "file not found". When I click "debug" it is always on the filecopy line. "Background=false doesn't appear to do any good. I also tried putting a for/next loop of varying lengths before the filecopy line to delay with no success. I can't seem to get the macro to wait til the pdf conversion is done. If I end macro execution, the pdf conversion then finishes and the file test.pdf is in the c:\temp directory, but of course the file hasn't been copied. (note: I set the pdfmaker filename to "test" and the output directory to "c:\temp" in the printer settings.)
Thank You
ActiveDocument.SaveAs FileName:="c:\test\test.doc", _
FileFormat:=wdFormatDocument
ActivePrinter = "Adobe PDF"
ActiveDocument.PrintOut Background = False
ActiveDocument.Close
FileCopy "c:\temp\test.pdf", "c:\data\test1.pdf"
Am trying to convert the active Word document to pdf in my macro. After conversion I want to copy the pdf that was made to a different directory. The pdf maker window pops up and it starts to convert. The progress bar stops part way through and a vba error pops up stating "file not found". When I click "debug" it is always on the filecopy line. "Background=false doesn't appear to do any good. I also tried putting a for/next loop of varying lengths before the filecopy line to delay with no success. I can't seem to get the macro to wait til the pdf conversion is done. If I end macro execution, the pdf conversion then finishes and the file test.pdf is in the c:\temp directory, but of course the file hasn't been copied. (note: I set the pdfmaker filename to "test" and the output directory to "c:\temp" in the printer settings.)
Thank You
ActiveDocument.SaveAs FileName:="c:\test\test.doc", _
FileFormat:=wdFormatDocument
ActivePrinter = "Adobe PDF"
ActiveDocument.PrintOut Background = False
ActiveDocument.Close
FileCopy "c:\temp\test.pdf", "c:\data\test1.pdf"