PDA

View Full Version : Keystrokes from Office Macro into third party App (SolidEdge 2D free)



andysuth
08-01-2007, 04:28 AM
Dear all,

Thanks for selecting my thread.

I've automated ProE (Engineering Solid Modelling Program) using a macro from MS Outlook which is triggered when the email with a code word is delivered.

However, I'm looking to apply the principle to a new package:
SolidEdge free 2D.

Background: Cad companies are at war with each other trying to get more users to convert from one package to another, and it's a pretty open battle at the moment, but one of the dark horses: UGS SolidEdge (which is quite a powerful package but very under-marketed) has a new weapon, FREE 2D cad that is parametrically driven.

It can be downloaded for free, I won't put the link here because everyone will think I'm working for them, which I'm not.

Real downside is that I can't control it in the same way that I'm controlling ProE because the free download doesn't have Macro/Trail file/keystroke file control.

I can open it though, with the file I want open, from a batch file or from an office macro.

What I want, is a way of getting outlook to send a message of "<ctrl><p>" (pause) "<return>" to the software window once open.

I realise that it is possible to do something similar with a TSR like "Click OK", but wnat to use a macro if possibly, to minimise the number of applications running on my PC.

IS IT POSSIBLE TO SEND A KEYSTROKE COMMAND TO AN OPEN WINDOW IN A THIRD PARTY APPLICATION FROM AN OFFICE MACRO?

:(

Cheers,

-AS

Bob Phillips
08-01-2007, 04:48 AM
Application.SendKeys "^p", True
Wait Now + TimeSerial(0, 0, 3) '3 secs
Application.SendKeys "~", True

andysuth
08-01-2007, 04:49 AM
I'm getting a "Notepad" window with just the letter "H" in it with this Code:





Sub hello()

Dim keystogo As String
keystogo = "Hello Notepad"
Shell "c:\windows\notepad.exe", vbMaximizedFocus
Application.SendKeys keystogo
End Sub





Surely that's not too far from what I want?

Is it possible to retain focus on the external window whilst sending Key strokes?

-AS