Hi...
This code appears to work on the development box when centering and sizing a
word application in front of the form that triggered the automation. But on
the target boxes, it skews down and to the right. And the size of the word
window is bigger than the form window that I'm calculating against (the word
window should be .9 as wide and .8 as high). I think it may have something
to do with the target box resolution or font size which is different than
the development box . Any help/code snippet would be appreciated since it's
the last piece before I complete my app for deployment.
Thanks
Steve
WordApp.Visible = True
WordApp.ActiveWindow.WindowState =
Word.WdWindowState.wdWindowStateNormal
WordApp.ActiveWindow.View.Zoom.Percentage = 75
WordApp.Resize(WordApp.PixelsToPoints(Int(0.9 * Me.Width),
False), WordApp.PixelsToPoints(Int(0.8 * Me.Height), True))
WordApp.Move(WordApp.PixelsToPoints(Me.Left, False) +
((WordApp.PixelsToPoints(Me.Width, False) - WordApp.Width) / 2), _
WordApp.PixelsToPoints(Me.Top, True) +
((WordApp.PixelsToPoints(Me.Height, True) - WordApp.Height) / 2))
----------------