locked
Is it possible to use a word macro to execute an .exe file? RRS feed

  • Question

  • Is it possible to use a word macro to execute an .exe file?
    How to do that?
    This is discussion is open to suggestions.
    Many thanks for your replying.

    Wednesday, August 15, 2007 6:36 AM

Answers

  • Hey,

     

    You can use the Shell function to run an application. Specify the correct pathname.

     

    Sub RunCalculator()

    Dim RetVal

    RetVal = Shell("C:\WINDOWS\SYSTEM32\CALC.EXE", 1)

    End Sub

     

    Best Regards

     

    Cathrine

     

    Wednesday, August 15, 2007 9:17 AM

All replies

  • Hey,

     

    You can use the Shell function to run an application. Specify the correct pathname.

     

    Sub RunCalculator()

    Dim RetVal

    RetVal = Shell("C:\WINDOWS\SYSTEM32\CALC.EXE", 1)

    End Sub

     

    Best Regards

     

    Cathrine

     

    Wednesday, August 15, 2007 9:17 AM
  • Thank you very much.

    It is very helpful.

    Thank you again.

     

    Thursday, August 16, 2007 1:12 AM
  • Sub NewMacro()
        Shell "C:\windows\System32\calc.exe", vbMaximizedFocus

    • Edited by Eric02000 Tuesday, January 31, 2017 9:11 PM
    Tuesday, January 31, 2017 9:11 PM