alsam
asked on
Using values from vb.net app to pupulate Word template
Hi,
I have word template (Path:"c:\Word_template\Te mplate.doc ") in which I want to replace merge fields with the values from the text boxes in vb.net desktop application. Here is example:
In word template document I have:
<< First and Last name>>
<< Address>>
<<Postal code>>
In vb.net I have:
Textbox1 containing First and Last name
TextBox2 containing Address
TextBox3 cnatining Postal Code
I tried to find some code on the net which will do I want but with no success... I would appreciate your help a lot in order to provide me with code which will solve my problem...
Additionally, there is merge field in the same word template named << Detailed info>> which I would like to replace with my datagridview from my form in vb.net application... is it possibble and if yes I would appreciate a lot your help once more in order to make it works...
Regards...
I have word template (Path:"c:\Word_template\Te
In word template document I have:
<< First and Last name>>
<< Address>>
<<Postal code>>
In vb.net I have:
Textbox1 containing First and Last name
TextBox2 containing Address
TextBox3 cnatining Postal Code
I tried to find some code on the net which will do I want but with no success... I would appreciate your help a lot in order to provide me with code which will solve my problem...
Additionally, there is merge field in the same word template named << Detailed info>> which I would like to replace with my datagridview from my form in vb.net application... is it possibble and if yes I would appreciate a lot your help once more in order to make it works...
Regards...
ASKER
Hello cubaman 24,
Thank you for your reply...
In the meanwhile I have successfully wrote the vb code which replace my bookmarks in word document and it works OK....
Unfortunatelly I have no idea how to show data in word document reflecting datagridview on the form... Actually I should show data from dataset/datatable in table in word...do you have any idea how to make this working...
Thanks
Thank you for your reply...
In the meanwhile I have successfully wrote the vb code which replace my bookmarks in word document and it works OK....
Unfortunatelly I have no idea how to show data in word document reflecting datagridview on the form... Actually I should show data from dataset/datatable in table in word...do you have any idea how to make this working...
Thanks
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks...
Try using an xslt template. It's incredible fast and easy. Also, you won't need to recompile your application if later the document template is modified.
http://weblogs.asp.net/cnagel/archive/2004/09/25/234188.aspx
Best regards.