473,734 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ActiveW indow.WindowSta te =
Word.WdWindowSt ate.wdWindowSta teNormal
WordApp.ActiveW indow.View.Zoom .Percentage = 75
WordApp.Resize( WordApp.PixelsT oPoints(Int(0.9 * Me.Width),
False), WordApp.PixelsT oPoints(Int(0.8 * Me.Height), True))
WordApp.Move(Wo rdApp.PixelsToP oints(Me.Left, False) +
((WordApp.Pixel sToPoints(Me.Wi dth, False) - WordApp.Width) / 2), _
WordApp.PixelsT oPoints(Me.Top, True) +
((WordApp.Pixel sToPoints(Me.He ight, True) - WordApp.Height) / 2))

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

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

Similar topics

2
1944
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 send with the automation code to ensure that Word opens into a maximised window? dixie
0
1338
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 the data source, then open a ..doc file from the template. The template has the name of the data file as its data source. All worked fine in Word 2000 and Word 2002, but all of a sudden, with Word 2003, I get an error message that says "This...
4
7681
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 handle the automation. So, i'm using the following code to create a new word document: ---Code---
4
11134
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 done this? Does it seem possible? I followed the instructions from a sample on the Microsoft knowledge base but it only seems to work when creating a VB.NET Windows .EXE, not an VB.NET ASP app.
1
1743
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 office automation in asp.net applications? In the old (asp) days I used to write the code in a com. Today we can use the visual basic codebehind page but - is it the right way? should I change the ASP.NET permissions
4
2510
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 Interop Assemblies (PIAs) for automating Word on the server and everything runs smoothly on the server console. The word documents are generated perfectly from all clients and stored on the server with some data comes from a SQL server and/or stores...
1
2679
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 beyond/overlap the form window (top, left, width or top). Thanks Steve
0
1123
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 it generates a exception "Object Reference not set
3
3243
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 display the document in a way that allows the user to view the document, but prohibits the document from being changed. I used HyperLink to attempt this, but the Word application is automatically launched, and the user can alter the document....
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.