Date: Mon, 29 Jan 2001 09:31:09 -0500
Reply-To: "Bross, Dean S" <dean.bross@HQ.MED.VA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Bross, Dean S" <dean.bross@HQ.MED.VA.GOV>
Subject: Re: SAS communication with MS Word
Content-Type: text/plain; charset="iso-8859-1"
I have written several routines in SAS that communicate
with WORD using DDE. The communication through DDE does
not use VB but instead uses an older language that is
no longer used by WORD for its own macros. I have WORD 97.
To my knowledge, you can't send VB through to WORD from
SAS. I have had some success with SAS applications writing
VB out to a file and then importing this file into WORDs
VB screen. This means that there is no longer an active
link between WORD and SAS. SAS runs first, and then WORD
takes the VB produced by that step, but runs separately.
If you create your VB macro within word and store it, then
it might be possible to access this stored VB from SAS.
Several years ago I did some experiments in which I attempted
to access a function written in VB through a DDE link from
SAS. I did seem to work but I never got it working perfectly.
Someone else on the list sent me the following tip:
The answer if you ever need it it to use OLE automation rather than DDE to
run the Word macro
I think you have to use SCL to make use of OLE. I have never
done this.
Dean Bross
> -----Original Message-----
> From: ZPAN [mailto:zpan@AOL.COM]
> Sent: Sunday, January 28, 2001 6:16 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: SAS communication with MS Word
>
>
> I want to write a SAS program which can create a MS Word macro and, if
> possible, invoke this macro.
>
> Different SAS programs produce different SAS outputs, and the
> SAS outputs need
> to be converted into MS Word files using different MS Word
> macros. It is easy
> to record those macros within MS Word application, but I do
> not know how to do
> it using SAS statements. I guess VB might be helpful.
>
>
> Can anybody help me out?
>
> Thanks, Ziqing
>