I was wondering if it is possible to create a Microsoft Word Document programmatically (through Java, C#, or another language). Is it also possible to do things like adding text or changing the font?
I know that we can start other programs from the command prompt, but what I want to do is to create the document programmatically without using the UI of Microsoft Word.
Can this be done?
in C# Import the COM reference Microsoft Word Object Library
using Microsoft.Office.Interop.Word;
You can then set variables for paragraphs, tables, etc
Dim oWord As Word.Application
Dim oDoc As Word.Document
Dim oTable As Word.Table
Dim oPara1 As Word.Paragraph, oPara2 As Word.Paragraph
C# tutorial
I am unfamiliar how to do it in JAVA but I am sure it is possible
It can also be done in VB.net (naturally!) Tutorial
Dont know about c# but Java has the Apache POI project which supports reading/writing word documents.
http://poi.apache.org/hwpf/index.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With