Forum Moderators: open
I'm fairly new to asp and I am trying to find my way through combining asp code with a word document.
I have an existing word document and an SQL Server database. Through an asp page, how do I get data from the database inserted into specific places in the word document? I am able to bring up the word document in the word application in the browser, but then I do not know how to insert the data into the document.
Any help is greatly appreciated.
asp is a server side language so if you automate word on the client, asp code cannot control it, if you automate word on the server then nobody sees it.
Having said that, the best way I have found to customise word docs on-the-fly , is to insert text strings into predefined bookmarks in a .dot template file - :
With ActiveDocument
.Bookmarks("bkAddress1").Range.InsertBefore objRS("Address1")
End With
For more info, look into the word object model on msdn
HTH