PDF Files

  • Thread starter Thread starter Ian
  • Start date Start date
I

Ian

I have a form which contains a hyperlink to a PDF file.
When I click on the link the size a position of the PDF
file window is a variable feast. Is it possible to control
the position and size of this window from within Access
(2002)?

Thanks for any help,
Ian.
 
Ian

Yup, it can be done. But this will require using a number of system calls.
Your code would have to find the hWnd of the PDF you just opened with an
EnumWindows() system call , and then use a MoveWindow() system call with the
hWnd to position and size the window to your requirements.

Take a look at
www.codehound.com/groups/default.asp?t=1,14,2,1_OHkyowT6AHA.1364@tkmsftngp04
_14 for a good example of the code you need for EnumWindows. You will want
to put this code in a Bas module in your database.

then you can add the following Declare to the same Bas module

Declare Function MoveWindow Lib "user32" (ByVal hWnd As Long, _
ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, _
ByVal nHeight As Long, ByVal bRepaint As Long) As Long

and actually move/resize the window after you get its handle like this:

Call MoveWindow (FindAnyWindow("The Caption from your PDF's Window"), 0, 0,
200, 200, True)

to move the window to the upper Left hand of the screen

Ron W
 
Ron,

Thanks for the help, much appreciated. The link you wrote
doesn't want to work on my system. Is there a way you can
guide me in from the www.codehound.com Home page?

Cheers,
Ian.
 
Back
Top