SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Embed a chart into a word document

Reply
Occasional Contributor
Posts: 9

Embed a chart into a word document

Hello,

 

I would like to use proc sgplot to create a chart, and then embed the resulting graphic into a microsoft word document. Is there code that will automate this process (i.e., so I don't have to manually open up Microsoft word to enter the chart?).

 

Thanks for your help!

 

Grand Advisor
Posts: 9,713

Re: Embed a chart into a word document

ods rtf file='c:/path/yourdocumentname.rtf' ;

 

<your sgplot goes here, actually any other procedure output you want>

 

ods rtf close;

 

creates RTF that Word can open.

You may need to specify a style on the ODS RTF statement as the default for RTF may be gray scale, something like style=HTMLBlue or whatever.

Occasional Contributor
Posts: 9

Re: Embed a chart into a word document

Thanks so much! Is there code to delete the date, time and page number that automatically appears in the RTF?

Grand Advisor
Posts: 16,309

Re: Embed a chart into a word document

Options nodate nonumber;

Post a Question
Discussion Stats
  • 3 replies
  • 145 views
  • 0 likes
  • 3 in conversation