Re: Read/Write Microsoft Word document
We had a guy here come up w/a fairly Rube-Goldbergian thing using
winword's mail merge feature. He defined merge fields in a word
document that referred to a text file, and then changed the contents of
the text file w/sas to "update" the word doc.
It worked well for the time his group needed it AFAIK...
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Wednesday, May 31, 2006 12:30 PM
Subject: Re: Read/Write Microsoft Word document
I think your method will "break" your WORD document. You my be able to
accomplish this using SAS via DDE. I don't have an example but there
are many SUGI papers and other SAS-L related discussions that should be
You should be able to use SAS to execute a find/change etc. through DDE,
I do this with SAS DDE to EXCEL but have not tried it with WORD.
I suspect there are more modern methods, that would be rather simple.
Others will be more helpful. Search the archives while you wait.
On 5/31/06, compilsys <email@example.com> wrote:
> Does anyone knows how to read a Microsoft Word document (not RTF) and
> write into a new one with some string modified...
> I tried :
> data _null_;
> infile 'c:\mydocument.doc' recfm=n length=len _infile_=tmp;
> if index(tmp,'stringtomodify') > 0 then
> tmp=tranwrd(tmp,'stringtomodify','stringmodified') ;
> put tmp $varying32767. len;
> ...but does'nt work.
> I choose WORD document because same RTF document is ~20MB instead of
> thanks folks
|Thread||Thread Starter||Forum||Replies||Last Post|
|Re: Read/Write Microsoft Word document||David L Cassell||Newsgroup comp.soft-sys.sas||0||06-01-2006 05:13 AM|
|Re: Read/Write Microsoft Word document||William W. Viergever||Newsgroup comp.soft-sys.sas||0||05-31-2006 08:46 PM|
|Re: Read/Write Microsoft Word document||Joe Whitehurst||Newsgroup comp.soft-sys.sas||0||05-31-2006 08:35 PM|
|Re: Read/Write Microsoft Word document||Alan Churchill||Newsgroup comp.soft-sys.sas||0||05-31-2006 08:31 PM|
|Re: Read/Write Microsoft Word document||data _null_;||Newsgroup comp.soft-sys.sas||0||05-31-2006 07:30 PM|