Developing for Dynamics GP

by David Musgrave (Perth, WA, Australia) and the Microsoft Dynamics GP Developer Support Team (Fargo, ND, USA)

VBA - Screen Size and Position Example

VBA - Screen Size and Position Example

  • Comments 0

The following VBA example allows a window to remember its size and position the next time it is opened.  This is really handy for transaction windows that you would like to see more lines at one time.

The code uses the DUOS (Dynamics User Object Store) to store the settings for each window on a per user basis.  As the DUOS table is already per company, the resulting data is stored per user per company.

The example uses the POP PO Entry window, however the code is generic (because it uses the Me object to refer to the current window) and so can be copied between windows.  The window is not modified in any way and you only need to add the window to Visual Basic, there is no need for any fields to be added to Visual Basic. 

If you are registered for the Customization Site License only and do not have the Modifier & VBA registered, it is possible to use notepad.exe to modify the package file to import it against different windows.

NOTE: The window position is not correctly remembered for v10.0 until SP2, due to a bug.

Example code for v8.0, v9.0 & v10.0 is attached at the bottom of the article.

Please see the "Installation Instructions.txt" file in each version's archive for more information.

Attachment: ScreenSizeExample.zip
Comments Information

PLEASE READ BEFORE POSTING

Please only post comments relating to the topic of this page.

If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.

Leave a Comment
  • Please add 1 and 6 and type the answer here:
  • Post