Add Page Action to Send to Excel on new list page -hardcoded

JenbotJenbot Member Posts: 4
edited 2015-01-27 in NAV Three Tier
Hi,
I have a client using NAV 2009 RTC and they want the Send to Word and Send to Excel page actions to be hardcoded into the Action Pane of a new list page.
Currently 'Ctrl+W' & 'Ctrl+E' work perfectly from the Page.
I just want to be able to run these functions from an Action at the top of the page, without requiring each user to personalise their page.
I have added new Page Actions 'Microsoft Excel' & 'Microsoft Word' to the list page.
I have promoted these actions.
I have used the Sendkeys functionality to try to export the page to word and excel.... however it is not working.
This is my code in the OnPush() of my new action top export to Excel:

IF ISCLEAR(WSHShell) THEN BEGIN
CREATE(WSHShell,FALSE,TRUE);
END;
WSHShell.SendKeys('^+E');

IF CONFIRM('Do you want to close the page?',TRUE) THEN
WSHShell.SendKeys('{ESC}');

CLEAR(WSHShell);


I added the confirm statement just to check whether the automation object was working properly, and when you select 'yes' on the confirm statement, the page closes, so I know that the WSHShell object is working ok....
I just can't seem to get the string right to send to Excel.

Does anyone know what I am doing wrong here, or if this is even possible?
Or is there another easy to export the page to Word and Excel?

Thanks!
Sign In or Register to comment.