Log in

View Full Version : Solved: KeyStrokes in SolidEdge 2D from Outlook or other Office Macro



andysuth
08-01-2007, 04:26 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

andysuth
08-06-2007, 01:10 AM
I'm actually solving this in Excel now, but the format might be useful here, so I've posted this before closing down this thread.


Sub SE2D()
Shell "C:\SE2D\Program\Edge.exe C:\PE3\AR\DOOR_001.dft", vbMaximizedFocus
Application.Wait Now() + TimeSerial(0, 0, 10)
Application.SendKeys "^p", True
Application.SendKeys "~", True
Application.SendKeys "~", True
End Sub


If you need other more specialised keys, curly brackets seem to be the way forward.

{up} for up arrow
{down} for down arrow
{tab} for tab
{f4} for f4
SendKeys "^p", <ctrl><p>

ETC.
etc.

Cheers,
-AS