BookmarkSubscribeRSS Feed
Cristina_inet
Fluorite | Level 6

Good morning,
We are generating in SAS an RTF file in which we are creating a table of contents.
For the table of contents to appear we have to select the entire document and press F9.
The important thing is that we want to remove that manual, we want the automatic table of contents to come out.
Do you know any way to do it? thanks greetings

 

 ods rtf text= "~S={outputwidth=100% just=l}{\field{\*\fldinst {\\TOC \\f \\h} } }";
ods RTF text="{\tc {\b\fs18\ql {Tabla &v_num..- MATRICULACIONES POR TIPOS DE VEHÍCULOS} \par}}";run;
4 REPLIES 4
Kathryn_SAS
SAS Employee

The Table of Contents will not automatically be populated. You will need to do this as documented below:

CONTENTS

produces a table of contents page for RTF documents that are opened in Microsoft Word. The table of contents page contains a Table of Contents field, which puts all of the contents information that is embedded in the document into a table of contents. To expand the table of contents, right-click under the title in Microsoft Word and select Update Field from the selection list.

 

Also see:

https://support.sas.com/kb/24/050.html

 

Cristina_inet
Fluorite | Level 6

Thank you very much for the reply.
What we need is that the rtf report appears with the index/table of contents without updating the file when opening it.
In the link you sent me you have to update the references.

Reeza
Super User
If you have XCMD enabled and are trying to automate a process I would write a VBS or PowerShell script that automated this and then run it at the end.
Cristina_inet
Fluorite | Level 6

Thank you very much for your answer.
For security, XCMD is not activated in our SAS.

we can't run scripts.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 504 views
  • 0 likes
  • 3 in conversation