BookmarkSubscribeRSS Feed
VD
Calcite | Level 5 VD
Calcite | Level 5

Hi,

I want to write a code which outputs a text in a html file. For instance,

ods html text="^S={font=('Arial',20pt,bold) outputwidth=100% just=c foreground=red}Test String";

It works on an html output but I also want to get the same text using MS Office add-in. So, when I run a stored process using the add-in, the text should appear in the MS Word document. Is there a way of doing this without explicitly coding rtf options?

Otherwise, what would be the rtf options which allows me to get the output from the office add-in?

Many thanks.

VD

3 REPLIES 3
ballardw
Super User

I don't use the office add in so this is a gues, but I would try using just ODS Text=. Then the text should go to all open ODS destinations.

Cynthia_sas
Diamond | Level 26

Hi:

In your stored process code, you can change your value for the reserved macro variable for destination:  &_ODSDEST=RTF or &_ODSDEST=HTML;  or you can explicitly use client-side options to alter the Stored Process results using the Add-in Options menu. If you do NOT have any overrides for &_ODSDEST, it is possible that the default result type in Word is SASReport XML.  I'm not sure that SASReport XML will accept ODS TEXT= strings and/or style overrides. So, you might want to be sure that the Word Add-in is not receiving SASReport XML results -- either by explicitly coding a value for &_ODSDEST or by checking the Add-in Options before you run the SP.

However, as long as you use ODS HTML TEXT=, ODS RTF would not get sent your text string. As ballardw says, the simple form ODS TEXT= is a better choice because it will write to all open destinations.

cynthia

VD
Calcite | Level 5 VD
Calcite | Level 5

Thank you, both.

I am now working on hard coding the ods options for the required outputs, so hopefully will work then.


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
  • 1546 views
  • 0 likes
  • 3 in conversation