I have the code below. It opens up a PDF in Acrobat.
I need to enhance this code by:
1) If the PDF doesn't exist it needs to return an error message to say "Can't find it". At the moment it just does nothing.
2) Is it possible to set the size of the PDF screen that appears? I'd like it to be half the screen size.
Private Declare Function ShellExecute Lib "shell32" _
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 Long
Private Const SW_SHOWNORMAL As Long = 1
Private Const SW_SHOWMAXIMIZED As Long = 3
Private Const SW_SHOWDEFAULT As Long = 10
Private Const SE_ERR_NOASSOC As Long = 31
Private Sub CommandButton1_Click()
Dim ThisDoc as Document
Dim strOurRefGuide As String
Set ThisDoc = ActiveDocument
strOurRefGuide = ThisDoc.AttachedTemplate.Path & "\OurRefGuide.pdf"
Call ShellExecute(0&, "open", strOurRefGuide, 0&, 0&, SW_SHOWNORMAL)