Bookmark and Share

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]

st: How to replace .docx file?


From   Friedrich Huebler <fhuebler@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: How to replace .docx file?
Date   Fri, 6 Dec 2013 10:51:35 -0500

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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index