Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Stas Kolenikov <skolenik@gmail.com> |

To |
"statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |

Subject |
Re: st: How to replace .docx file? |

Date |
Fri, 6 Dec 2013 11:17:34 -0600 |

You're welcome. Don't you agree that Stata documentation is much easier to follow that R's? ;) -- Stas Kolenikov, PhD, PStat (ASA, SSC) -- Senior Survey Statistician, Abt SRBI -- Opinions stated in this email are mine only, and do not reflect the position of my employer -- http://stas.kolenikov.name On Fri, Dec 6, 2013 at 10:35 AM, Friedrich Huebler <fhuebler@gmail.com> wrote: > Thank you, Stas, you are right. Problem solved. > > Friedrich > > > On Fri, Dec 6, 2013 at 11:25 AM, Stas Kolenikov <skolenik@gmail.com> wrote: >> -real scalar replace- indicates that this must be a number, rather >> than a string, as you specified. The help file says that anything >> non-zero would be considered, in Stata's tradition of logical >> expression evaluation, to be true. So you instead need to write >> >> _docx_save(dh, "example.docx", 1) >> >> >> -- Stas Kolenikov, PhD, PStat (ASA, SSC) >> -- Senior Survey Statistician, Abt SRBI >> -- Opinions stated in this email are mine only, and do not reflect the >> position of my employer >> -- http://stas.kolenikov.name >> >> >> >> On Fri, Dec 6, 2013 at 9:51 AM, Friedrich Huebler <fhuebler@gmail.com> wrote: >>> I am experimenting with the creation of .docx files and don't know how >>> to specify the -replace- option. According to -help mf__docx-, >>> documents are saved with this command: >>> >>> _docx_save(dh, string scalar filename [, real scalar replace]) >>> >>> Take this example, adapted from -help mf__docx-. >>> >>> * Create a document >>> mata: >>> dh = _docx_new() >>> end >>> >>> * Add some text >>> mata: >>> _docx_paragraph_new(dh, "Some text") >>> end >>> >>> * Save file >>> mata: >>> res = _docx_save(dh, "example.docx") >>> end >>> >>> * Replace file >>> mata: >>> res = _docx_save(dh, "example.docx", replace) >>> end >>> >>> The last command results in an error message. >>> >>> . * Replace file >>> . mata: >>> ------------------------------------------------- mata (type end to >>> exit) -------------------------------------- >>> : res = _docx_save(dh, "example.docx", replace) >>> <istmt>: 3499 replace not found >>> (0 lines skipped) >>> ---------------------------------------------------------------------------------------------------------------- >>> r(3499); >>> >>> I tried different variations of the -replace- option with the same >>> result. What am I doing wrong? >>> >>> Friedrich > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

**References**:**st: How to replace .docx file?***From:*Friedrich Huebler <fhuebler@gmail.com>

**Re: st: How to replace .docx file?***From:*Stas Kolenikov <skolenik@gmail.com>

**Re: st: How to replace .docx file?***From:*Friedrich Huebler <fhuebler@gmail.com>

- Prev by Date:
**Re: st: How to replace .docx file?** - Next by Date:
**Re: st: Survival Analysis estat phtest with very large sample size--need help** - Previous by thread:
**Re: st: How to replace .docx file?** - Next by thread:
**st: Re:Forecasting GDP Levels when D.GDP was used in SVAR estimation** - Index(es):