03-28-2013 01:10 PM
Hi fellow Forum members,
I would like to link to SAS output tables from MS-Word documents. I tried creating the tables into a RTF document with anchors using ODS and then referring to these anchors from my Word report. That didn't work. I can create a hyperlink to the table in the RTF document but I can't make the table appear in my report. Can it be done?
03-28-2013 02:42 PM
03-28-2013 03:01 PM
Thanks Art for the detailled instructions. I tried that and it didn't include anything into my Word document (it didn't signal any error). Does it work for you? I'm using SAS 9.3 and Word 2007.
03-28-2013 04:00 PM
Yes it did work for me. I'm using Word 2010. However, it wouldn't update the document when the html or rtf document changed.
If you can attach one of the files, I'll see if it works on that particular file.
03-28-2013 04:26 PM
: Try following the instructions shown in the following link: Automatically Updating Text in Many Documents
This actually links the files with the new document so that the document is updated when anything in the link changes. The instructions, basically, are just to:
1. Create a document containing the text you want to link to
2. Copy the text you would like to insert in your other documents
3. Open the document where you would like to insert the text
4. Place the cursor where you would like the text to appear
5. From the Edit menu, select Paste Special
6. From the Paste Special dialog box, select Paste Link
I tested it, at least in Word2010, by inserting an HTML document into the new document. I presume it should work with rtf as well.
03-28-2013 05:51 PM
Thanks for your time and ideas. Like so many half baked features in MS-Office, this one almost looks like it works. When I paste a link to my table, Word inserts a new bookmark in the RTF file. It call it OLE_LINK1. It doesn't use the bookmark that was inserted by SAS for the same table. If I edit the RTF file with Word, the edits will be carried over to my report. But this also means that when I update the RTF file by running my SAS program again, the inserted link (OLE_LINK1) is lost and the link is broken.
03-28-2013 03:28 PM
Can you explain a bit more of what you're trying to do?
What do you mean by a SAS Table? Is it in another word document and what kind of link are you looking for.
03-28-2013 03:36 PM
A SAS table is the formatted version of an ODS dataset. I guessed the RTF version of a table would be the most compatible with Word.
I am looking for an updatable (dynamic?) link. If I redid the analysis in SAS, I would like to see the updated version in my Word report.
03-28-2013 03:40 PM
Is that still a SAS dataset, ie sas7bdat file?
You can embed an excel table into a word document. And if you update the source excel table via SAS either through a simple proc export, DDE or other manner it should update in Word as well.
03-28-2013 05:11 PM
Thanks for the suggestion Reeza, but a raw data table is not what I need to include in my report.
It's the formatted version of a SAS table that I want to link to, something like :
It would be part of a RTF file and pointed to within the file by an anchor name. I can bring such a table from the RTF output to my report with cut and paste but I would like to make the process automatic.