|
|||
|
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... -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of data _null_; Sent: Wednesday, May 31, 2006 12:30 PM To: SAS-L@LISTSERV.UGA.EDU 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 helpful. 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 <pmaradan@compilsys.com> wrote: > Hi, > 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; > input; > if index(tmp,'stringtomodify') > 0 then > tmp=tranwrd(tmp,'stringtomodify','stringmodified') ; > put tmp $varying32767. len; > run; > > ...but does'nt work. > I choose WORD document because same RTF document is ~20MB instead of > ~350K... > thanks folks > Pascal > |
|
|
||||
|
||||
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| 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 |