Hi Ashwin,If you instaled PDF Reader in the client machineusing shell command yopu can open the file.elsein your project (for Adobe Acrobat ) use the AcroPDF.dllregardskumaran v- Original Message -From: Ashwin Prajapati via vb-access-l To: Kumaran Sent: Friday, November 16, 2007 6:32:02 PMSubject: vb-access-l Open.pdf file using VB CodeDear alli want to know, how to open a.pdf file using Visual Basic CodingWhat will be procedure to do this? First you declare an API functionPrivate Declare Function ShellExecute Lib 'shell32.dll' Alias 'ShellExecuteA' (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongThen call the functionyou can open any type of file word,excel,jpeg,pdf etc.ShellExecute 0, vbNullString, 'C:sample.pdf', vbNullString, vbNullString, 1Ashwin Prajapati via vb-access-l wrote:Dear alli want to know, how to open a.pdf file using Visual Basic CodingWhat will be procedure to do this?
I have done some search already on this topic and many have already said that password protected file saving through VBA script does not work. But it is possible to save file using dialogbox manually.Here is the code which does not save file with password protectionActiveDocument.SaveAs2 FileName:=FileName, Password:='aaaaaaa', AddToRecentFiles:=False, WritePassword:='aaaaaa', FileFormat:=WdSaveFormat.wdFormatPDFSo other way to do is using dialog boxWith Dialogs(wdDialogFileSaveAs).Name = FileNameEL.Format = wdFormatPDFEndWithDoes any one know, how to add to this VBA code, option selection and settings which will do following manual steps1.
Selecting checkbox 'Encrypt the document with password'2. Enter password in 'password' & 'renterpassword'4. Click 'ok'I have tried to record macro but the captured code do not have password.There are other ways to do using third-party software but I want to avoid those.
Vb6 Pdf Create
As Doug has indicated the Office PDF option does not include an option for password protection. You can however do it with the open source PDFCreator. Personally I prefer the earlier version 1.7.3, which is still available fromThe installer will try and install all sorts of other dross that you don't need (or want) so make sure that you check the various dialogs and only install the basic PDF Creator application.