开发者

Fillable doc files

开发者 https://www.devze.com 2023-03-27 06:59 出处:网络
I have a samples of some documents in .doc format开发者_高级运维. So I need to create some \"fillable@ areas instead of certain values in samples. Then I need to automatically fill this documents usin

I have a samples of some documents in .doc format开发者_高级运维. So I need to create some "fillable@ areas instead of certain values in samples. Then I need to automatically fill this documents using C#. So what do you think about it? Is that possible? Thanks in advance, guys! P.S.: if you need some information from me please feel free to ask me about additions to my question.


Besides simply injecting/replacing text into the document itself you could also utilize docvariables. You can define/create them in your document and then you can codewise set the values.

Using docvariables you seperate the design of the worddoc (where is the text shown) from setting the values which might be usefull for your case.

You can certainly manipulate them using C# but a bit more info using a vba sample can found at What is a DOCVARIABLE in word

One little warning when using c# to edit them. If you set the value of a docvariable to "" (empty string) it results in the docvariable being deleted from the document. If you want to keep the docvariable around set it's value to a " " (space)


Yes this is possible, you can create in your Document a placeholder areas which you search and change when you access the file. Check these results on how to modify the word document using C#

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号