BookmarkSubscribeRSS Feed
azorachase
Calcite | Level 5

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!

 

3 REPLIES 3
ballardw
Super User

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.

azorachase
Calcite | Level 5

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

Reeza
Super User

Options nodate nonumber;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Discussion stats
  • 3 replies
  • 1804 views
  • 0 likes
  • 3 in conversation