11-22-2016 11:42 AM
I am creating customized reports for my clients in Microsoft Word. I have to insert a SAS-created graph into each of the reports, in the same location in each report. Is there a method of automating this copy and paste process using SAS? Can I use SAS DDE for this? Any code would be appreciated.
Many thanks in advance.
11-22-2016 12:02 PM
Well, DDE is very old, wouldn't recommend it. You can setup your Word document to use file references - i.e. have the picture saved in a separate file, that is loaded at open of the Word document.
This would be the best method to do this - or move to a reporting platform. Actually embedding the file itself each time would be quite complex. SAS doesn't know the setup of your document, so it would need to call VBA, which would then process and update as needed, but thats out of scope for this forum.
11-22-2016 01:01 PM
Thank you for your quick reply. The graph that I need to paste into each document is created in SAS. I know that ODS code can be used to output and save graphs, but I'm not sure which file types are compatible with Word. Sorry, I'm quite a newbie to all of this .
Can you please suggest what ODS code I can use to output a graph as a picture file that can be readily embedded into my document? I plan on using the "Insert and Link" method described in the article that you sent to me.
11-22-2016 03:30 PM
You want to create a PNG, JPG or SVG file instead.
You can specify the format on the ODS GRAPHICS statement.