‎2009 Jul 17 9:39 AM
Hi all,
I created one MACRO in Microsoft office and now i want to call this macro in my ABAP program.
How to do this can anyone provide me the logic for this....
Regards.
‎2009 Jul 17 9:56 AM
>
> How to do this can anyone provide me the logic for this....
.
I'm sorry if i could not able to give you exact logic, but reading [this stuff |http://www.abapprogramming.net/2008/02/r3-rfc-from-ms-office-via-visual-basic.html]might worth full enough.
Cheers
‎2009 Jul 17 10:37 AM
hi,
use this method
This word template has the Macro that will Run when the document is opened using method: cl_gui_frontend_services=>execute
‎2009 Jul 17 10:47 AM
Hi Milan,
Thanks for your help but can u explain more clearly how to use this...method
‎2009 Jul 17 3:31 PM
What Office application/document has the macro? What the other poster was referring to is that you can open any type of Office document, E-mail editor, PDF document, simply by executing the filename or appropriate shell command. By opening the Office document that has the embedded macro, you would trigger that macro to execute. Is that what you need?
Here is a simple example (with a hard-coded filename):
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
EXPORTING
DOCUMENT = 'C:\temp\mydoc.doc'
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
BAD_PARAMETER = 3
FILE_NOT_FOUND = 4
PATH_NOT_FOUND = 5
FILE_EXTENSION_UNKNOWN = 6
ERROR_EXECUTE_FAILED = 7
SYNCHRONOUS_FAILED = 8
NOT_SUPPORTED_BY_GUI = 9
OTHERS = 10.
As I mentioned, this is also useful for triggering other applications, such as your resident e-mail editor, based on a click of an e-mail address in a GUI screen:
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
EXPORTING
DOCUMENT = 'mailto:(put address here)'
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
BAD_PARAMETER = 3
FILE_NOT_FOUND = 4
PATH_NOT_FOUND = 5
FILE_EXTENSION_UNKNOWN = 6
ERROR_EXECUTE_FAILED = 7
SYNCHRONOUS_FAILED = 8
NOT_SUPPORTED_BY_GUI = 9
OTHERS = 10.