Getting SAS Graphics into Word, Powerpoint, etc.

There are several methods for getting graphics from SAS and SAS/Insight into other Windows applications, such as Word and Powerpoint.

Using Cut and Paste

The easiest method is to use cut and paste. This tip was posted on the SAS News Group, comp.soft-sys.sas:
From: john.hixon@KODAK.COM
Newsgroups: comp.soft-sys.sas
Subject: Re: SAS/GRAPH and TrueType fonts
Date: 28 Feb 02 19:39:52 GMT
Reply-To: john.hixon@KODAK.COM
I've always found that I can get perfectly acceptable SAS graphs into my Word docs by following this procedure:
  1. Use SAS Graph to make the graph so that it appears how you would like it in your Word Doc (using goptions like: vsize= hsize= ftext= ftitle= etc...). For example,
    goptions hsize=4in vsize=3in ftext=swiss htext=2;
    
  2. Use your mouse to select the graph region to paste into Word. (Note: do NOT just use Edit/Copy, or Ctrl-C, you must enclose the graph by using your mouse.)
  3. After using your mouse to enclose the graph, either use CTRL-C or Edit/Copy to copy the graph to the clipboard.
  4. In Word use Edit/Paste Special/Device Independent Bitmap to put it into your document.

Using the %GRAPHOUT macro

The graphout macro uses the GREPLAY procedure to replay any or all of the graphs previously generated in your SAS session, saving each one to an individual file, for use with word processing programs, etc. This works with SAS/Graph, but not with SAS/INSIGHT.

With this method, simply generate your graphs in the graphics window as usual. Each graph is stored in a graphics catalog, typically named WORK.GSEG. Then, choose the graphic format you want to export to (e.g., GIF, BMP, WMF, JPG), decide which graphs you want to export, and call the graphout macro. For example:

 %graphout(device=jpeg, ext=jpg,
   name=myfig,         /* call them myfig1.jpg, ... */
   outdir=F:\graphs,   /* save them in F:\graphs\   */
   first=1, last=4);   /* do 1..4                   */

Michael Friendly