473,327 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

need help centering a word application window during automation

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))

----------------
Dec 13 '06 #1
0 1000

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: dixie | last post by:
When I do a mailmerge from Access to Word by automation, sometimes, the Word window does not fully open and can be found up in the very top left hand corner of the screen. Is there a command I can...
0
by: dixie | last post by:
I have an application which does a lot of reports (letters) by automation with Word. The mail merge main document is a Word template and I transfer a text file out to a prenamed filename to act as...
4
by: Daniel | last post by:
Hello, i have a problem with the word automation from c#. First, i want to mention, that i don't have any dependencies from word in my c#-project, i want to use the system.reflection model to...
4
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
1
by: mr net | last post by:
Hi, I'm trying to write: Dim objWord As New Word.Application in the codebehind page but I'm getting the error written below. The question is what is the correct way to use word or any other...
4
by: Kash | last post by:
Hi everybody: I've developed a web application running on a 2003 server not on the web but on extranet environment of a small Firm (less than 10 users). I've taken benefit of Office Primary...
1
by: Steve | last post by:
I am trying to figure out how I can center and size a word application active window within my vb.net form when the word document is open using automation so that the word window doesn't extend...
0
by: apondu | last post by:
Hi, can someone help me and provide me the information on how to supress the default action of the shortcut keys of word during word automation. I am using C#.Net I have written a code but...
3
by: Greg (codepug | last post by:
For the purpose of viewing a document that I would like to modify on rare occassion using word. I would like to create a document with MS Word, and then have my Access Application launch and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.