I have a method used to reset the window size after opening as below
Sub ResetWindow()
Dim xPos as Integer
Dim yPos as Integer
Dim width as Integer
Dim win as Visio.Window
Set win = Application.Window
Dim hWnd as Long
hWnd = win.WindowHandle32
Dim ret as Long
xPos = GetSystemMetrics(0)
yPos = GetSystemMetrics(1)
width = xPos / 2
ret = SetWindowPos(hWnd, HWND_TOP, width - 2, 0, width + 2, yPos - 34, SWP_NOSIZE)
End sub
This code worked perfectly in Visio 2003, but when i executed it using Visio 2000, a [Error '438' Object Doesn't Support This Property Or Method] error was generated at [Set win = Application.Window]. The reason seems to be that [Application] variable is not recognizable or not supported in Visio 2000. So i wonder if there is a way to handle this problem.
Thank you very much in advance
Instead of:
Dim win as Visio.Window
Set win = Application.Window
Dim hWnd as Long
hWnd = win.WindowHandle32
Try this:
Dim hWnd as Long
hWnd = Application.WindowHandle32
Thank you very much. it worked perfectly