Hello,
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.
Hi,
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.
http://www.labnol.org/software/insert-images-in-word-documents/8144/
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.
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.
Thanks!!
You want to create a PNG, JPG or SVG file instead.
You can specify the format on the ODS GRAPHICS statement.
Great, thanks!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!