BookmarkSubscribeRSS Feed
azorachase
Calcite | Level 5

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.

 

 

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

 

azorachase
Calcite | Level 5

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!!

Reeza
Super User

You want to create a PNG, JPG or SVG file instead.

You can specify the format on the ODS GRAPHICS statement.

 

http://support.sas.com/documentation/cdl/en/odsug/67921/HTML/default/viewer.htm#p0kroq43yu0lspn16hk1...

 

 

 

 

azorachase
Calcite | Level 5

Great, thanks!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Discussion stats
  • 4 replies
  • 1125 views
  • 1 like
  • 3 in conversation