![]() |
How to embed a PDF file into a userform
Hi there
I saw a post the other day with someone asking how to show or embed an acrobat file in a userform. I can't remember who it was that posted but I thought I would put this up just in case they are on line having a look. This works with Excel 2000 SP3 and Acrobat reader 6 I can't tell you if it will work with any other versions as I don't have them to test. In the VBETools MenuReferences check the checkbox for "Acrobat control for ActiveX". Then on your toolbox right click and select addition controls and again check the "Acrobat control for ActiveX" checkbox. This will add an adobe acrobat control to your toolbox. Drag a PDF control on to a user form and then add the following code Option Explicit Private Sub UserForm_Initialize() Pdf1.LoadFile ("C:\Test\excel vba.pdf") ' you can use this to turn the toolbars on and off Pdf1.setShowToolbar False End Sub ' when you unload the form you need to close the PDF before doing so or acrobat will ' give you an error. I'm not sure if this is the best way but it worked for me. Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) Pdf1.LoadFile ("") End Sub Hope this is of some help. Laterz S |
All times are GMT +1. The time now is 12:32 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com