How to create a Word XML file based on a template and fill it with user input???

  • Thread starter Thread starter Daniel Walzenbach
  • Start date Start date
D

Daniel Walzenbach

Hello,



I want to create a Word XML file based on the input users make in a VB.NET application. I imagine creating a template in Word and saving it as a XML file. I then want to fill the template (in my application) based on the user input. When the document gets opened there should be fields users can change but others should be prevented from beeing changed (I know that an "open" file format like XML can always be modified to allow changees if the file gets opened with i.e. notepad). Does anybody know how I can do this or even better has some code?


Best regards

Daniel Walzenbach

P.S. If you need to contact me simply remove ".NOSPAM" from my email address.
 
Hi,

The office system 2003 uses xml natively. Here is a link to some documentation.

http://msdn.microsoft.com/office/un...n-us/odc_wd2003_ta/html/odc_wdnew2k3xmlom.asp

Ken
---------------------------
Hello,



I want to create a Word XML file based on the input users make in a VB.NET application. I imagine creating a template in Word and saving it as a XML file. I then want to fill the template (in my application) based on the user input. When the document gets opened there should be fields users can change but others should be prevented from beeing changed (I know that an "open" file format like XML can always be modified to allow changees if the file gets opened with i.e. notepad). Does anybody know how I can do this or even better has some code?


Best regards

Daniel Walzenbach

P.S. If you need to contact me simply remove ".NOSPAM" from my email address.
 
Thank you Ken,

this great!

Daniel
Hi,

The office system 2003 uses xml natively. Here is a link to some documentation.

http://msdn.microsoft.com/office/un...n-us/odc_wd2003_ta/html/odc_wdnew2k3xmlom.asp

Ken
---------------------------
Hello,



I want to create a Word XML file based on the input users make in a VB.NET application. I imagine creating a template in Word and saving it as a XML file. I then want to fill the template (in my application) based on the user input. When the document gets opened there should be fields users can change but others should be prevented from beeing changed (I know that an "open" file format like XML can always be modified to allow changees if the file gets opened with i.e. notepad). Does anybody know how I can do this or even better has some code?


Best regards

Daniel Walzenbach

P.S. If you need to contact me simply remove ".NOSPAM" from my email address.
 
Daniel,

If I understand you correctly, you wish to design a template in Word with 'place holders' for data which are filled by users in your vb.net application.

I don't think you need an XML approach at all. All you need to use are Bookmarks. Using bookmarks as 'Data Place-Holders' is a std practice. To fill the bookmarks with user entered data, use Office automation.

To control editing, use need to use the 'Forms' toolbar in word when you design your template. Right click on the main toolbar in word and see what options you have in the forms toolbar.

Note: You have to click on Lock button to enable editing restrictions.

Thank you Ken,

this great!

Daniel
Hi,

The office system 2003 uses xml natively. Here is a link to some documentation.

http://msdn.microsoft.com/office/un...n-us/odc_wd2003_ta/html/odc_wdnew2k3xmlom.asp

Ken
---------------------------
Hello,



I want to create a Word XML file based on the input users make in a VB.NET application. I imagine creating a template in Word and saving it as a XML file. I then want to fill the template (in my application) based on the user input. When the document gets opened there should be fields users can change but others should be prevented from beeing changed (I know that an "open" file format like XML can always be modified to allow changees if the file gets opened with i.e. notepad). Does anybody know how I can do this or even better has some code?


Best regards

Daniel Walzenbach

P.S. If you need to contact me simply remove ".NOSPAM" from my email address.
 
Daniel,

If I understand you correctly, you wish to design a template in Word with
'place holders' for data which are filled by users in your vb.net
application.

I don't think you need an XML approach at all. All you need to use are
Bookmarks. Using bookmarks as 'Data Place-Holders' is a std practice. To
fill the bookmarks with user entered data, use Office automation.

To control editing, use need to use the 'Forms' toolbar in word when you
design your template. Right click on the main toolbar in word and see what
options you have in the forms toolbar.

Note: You have to click on Lock button to enable editing restrictions.
 
Hello,

I want to create the file on a webserver and deliver it to a user. I always thought that word automation shold only be used on the user's client. Am I right with this assumption? I thought that it might be easier for me to create a XML file on the server than a .doc file.

Greetings
Daniel

Daniel,

If I understand you correctly, you wish to design a template in Word with 'place holders' for data which are filled by users in your vb.net application.

I don't think you need an XML approach at all. All you need to use are Bookmarks. Using bookmarks as 'Data Place-Holders' is a std practice. To fill the bookmarks with user entered data, use Office automation.

To control editing, use need to use the 'Forms' toolbar in word when you design your template. Right click on the main toolbar in word and see what options you have in the forms toolbar.

Note: You have to click on Lock button to enable editing restrictions.

Thank you Ken,

this great!

Daniel
Hi,

The office system 2003 uses xml natively. Here is a link to some documentation.

http://msdn.microsoft.com/office/un...n-us/odc_wd2003_ta/html/odc_wdnew2k3xmlom.asp

Ken
---------------------------
Hello,



I want to create a Word XML file based on the input users make in a VB.NET application. I imagine creating a template in Word and saving it as a XML file. I then want to fill the template (in my application) based on the user input. When the document gets opened there should be fields users can change but others should be prevented from beeing changed (I know that an "open" file format like XML can always be modified to allow changees if the file gets opened with i.e. notepad). Does anybody know how I can do this or even better has some code?


Best regards

Daniel Walzenbach

P.S. If you need to contact me simply remove ".NOSPAM" from my email address.
 
Hi Daniel,

Yes.
If you are automation office in the server side, Here is link you may need
to pay attention.
257757 INFO: Considerations for Server-Side Automation of Office
http://support.microsoft.com/?id=257757
So I think Ken's suggestion is better one.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Daniel,

Yes, you are right, if you are creating the documents on the server, XML is
the best approach as if you use office automation you will also encounter
some licensing issues.
 
Back
Top