Brian,
 
    For ensuring that documents opened by clicking a hyperlink control on the form, get displayed in maximized state, we have to allow for the time delay involved in activation and stabilization of the target document.
 
    When FollowHyperlink method of access application, based upon path of target document is used (instead of direct hyperlink), the required time lag can be accommodated in the click event itself, using a suitable time delay loop incorporating WithEvents statement.
 
    The alternative mentioned in previous para is not available when clicking hyperlink type control. Execution of code in click event precedes activation of hyperlink. In such a situation, the desired objective can be achieved by transient activation / de-activation of form's timer. Sample code for form's module, as given below, should get you the desired results.
 
    It may please be ensured that [Event Procedure] appears on Event tab of the properties dialog box of the form (against the item: On Tmer) as well as TxtLinkDoc (against the item: On Click).
 
Best wishes,
A.D.Tejpal
 
Form's VBA Module
(TxtLinkDoc is the name of hyperlink type control)
====================================
' General Declarations Section
' Global variables
Private Hwd As Long, TotTime As Long
' Set max limit for time out = 10 seconds
Private Const MaxTime As Long = 10000
 
' API declarations
Private Declare Function GetForegroundWindow _
                                            Lib "user32" () As Long
Private Declare Function ShowWindow _
                        Lib "user32" (ByVal hwnd As Long, _
                        ByVal nCmdShow As Long) As Long
----------------------------------------------------------------
Private Sub Form_Timer()
    Dim HwDoc As Long
   
    TotTime = TotTime + Me.TimerInterval
    If TotTime > MaxTime Then   ' Time out
        Me.TimerInterval = 0
        Exit Sub
    End If
   
    HwDoc = GetForegroundWindow()
    If HwDoc <> Hwd Then
        ShowWindow HwDoc, 3   ' 3 for maximized state
        Me.TimerInterval = 0
    End If
End Sub
 
Private Sub TxtLinkDoc_Click()
    TotTime = 0
    Hwd = Application.hWndAccessApp
    Me.TimerInterval = 200

End Sub
====================================
 
----- Original Message -----
Sent: Friday, June 10, 2005 21:43
Subject: [AccessDevelopers] Maximize Adobe Reader Window opened by clicking hyperlink in Access

I have an Access DB with a bunch of searchable topic names and each topic has a corresponding hyperlink to a pdf file.  One minor annoyance my users are complaining about is that the Adobe window that opens when they click the hyperlink is always rather small and they have to maximize the window every time.  Is there a way I can force that window to open maximized?

Thanks,

Brian Stenglein



Please zip all files prior to uploading to Files section.




Yahoo! Groups Links

Reply via email to