Thank you for viewing my question. I was introduced to DocX yesterday, and everything has been going well so far, except this one issue.
I have built an asp.net application that builds a document automatically from user input in a web browser. The problem is that program is server side. Figuring out how to open the document client said has been a big pain for me.
Thus far, I have been able to save the document to a MemoryStream, but that is as far as I have gotten. How can I 'grab' the data from memory stream and allow the user on the client side download the doc?
I will post segments of code below. (This is obviously not all the code, but only a portion that pertains to this question.
ANY help will be greatly appreciated!
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
__Dim filename As String = "Minutes.docx"
Dim contents As Byte()
Using ms As New MemoryStream()
Using document As DocX = DocX.Create(filename)
Dim header As Header = document.Headers.odd
Dim header2 As Header = document.Headers.even
Dim h As Paragraph = header.InsertParagraph()
h.Alignment = Alignment.center
Dim h2 As Paragraph = header2.InsertParagraph()
h2.Alignment = Alignment.center
Dim p As Paragraph = document.InsertParagraph()
p.Append(commnamedd.Text + " Committee").Font(New FontFamily("Arial"))
p.Alignment = Alignment.center
p.LineSpacingAfter = 1
contents = ms.ToArray()