Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi program code

Status
Not open for further replies.

wooonelly

IS-IT--Management
Feb 23, 2006
19
0
0
US
Here is what I need, please be patient:

PowerMILL(drafting program), is open
a point is selected,
when F1 is pushed a window comes up giving the coordinates of the point,
I would like this window copied(alt+print screen) and pasted into a word document by this code so the user doesn't have to keep switching back and forth, copying and pasting.

There are a number of points so this needs to be done many times and so the user doesn't have to keep switching programs this would help out.

Can this be done? If so, how?
 

You will have to run this from PowerMILL, not Word. From a quick look at the PowerMILL website it appears it may be able to run VBA. If so, what you need to do (if you can) is:

Have a mechanism (a hotkey might work) so that the user can communicate with your macro and your application from a 'single' UI.

When they have pressed F1, they must then (using your chosen mechanism) signal the macro to continue or restart and it must do the print screen and then paste into Word.

Now it gets tricky! PrintScreen can be invoked programmatically using SendKeys only via WordBasic (unless PowerMILL itself provides a facility) and the trouble with SendKeys is that it is directed to the window with the focus. If you're not very careful the F1 window won't retain the focus and may not be printable this way. APIs can be used but it's not for the faint of heart.

If you think this is at all viable in your environment and need more help, please come back, but my personal recommendation would be to size the on-screen windows so that both PowerMILL and Word are visible at the same time so that only a mouse movement is required to switch actions between them.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Also, by chance VBA doesn't work, have you looked at third-party software? You have not mentioned what is done with this after you go through the steps so I don't know what you intend to do.

For example, I have a third party software on some of my client machines that will take a screenshot and save it directly to a jpg file by just pressing F11. It is named based on a format I defined.

I have a nother machine, using the same piece of software, that automatically creates a screenshot and saves it to a jpg every 10 seconds when a certain app is running.

Hope this helps a bit....

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top