Solved

VBA/ How to Position Word Document Window and VBE Window Side By Side

Posted on 2009-03-29
4
321 Views
Last Modified: 2013-11-25
In a nutshell: I want to be able to quickly position the word document window (left half of screen) side by side with the VBA code editor (right half of the screen)

I am looking for some VBA code (will probably include api calls) that will position:
1) The window of the word document I am working with (identifying it by application.caption, I suppose) to the top left hand corner of the screen, and resize the window to take up half of the screen horizontally and the full screen vertically.
2) The VBA code editor to take up the right half of the screen.
0
Comment
Question by:PioneerSolutions
  • 2
  • 2
4 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
Comment Utility
You don't say why you don't simply 'Tile Windows Vertically' with only the two windows open and unminimised.
0
 

Author Comment

by:PioneerSolutions
Comment Utility
Hi Graham,
I am working with several windows and during debugging sessions I sometimes need to isolate these two windows. Moreover my question is simplified. Long term, I will tweak the exact sizes and positions, as needed.
Regards,
e
0
 
LVL 76

Expert Comment

by:GrahamSkan
Comment Utility
OK.
I was asking, because I believe that it requires the use of APIs and quite a lot of research. In fact I think that it is more of a project that a question, so if there were already a workaround...
0
 

Accepted Solution

by:
PioneerSolutions earned 0 total points
Comment Utility
I believe it requires the use of two API's FindWindow and MoveWindow. I am just not sure how to put it all together, including getting the handle (hwnd) of the Word window and VBE window. It may also require the use of CreateObject function and the use of Application.Caption. Again, I am not sure how to put it all together. But from my reading online these seem to be the keys to solving this. Anyways, don't bother researching it. I hope someone with VB experience will come across this question.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now