I'm trying to create a function to replace fields in a word document using asp.net. The fields are marked in the document using ###field### and I need to replace them with the data from the DB. The code I have works fine for the body of the word document but doesn't appear to work if the text is contained within a textbox, is there a way to correct this?
Here's the code I am currently using
Dim Contract as string
Dim word As New Word.Application Dim doc As Word.Document Try word.Documents.Open("c:\FYI.doc") word.Visible = True
doc = word.ActiveDocument Dim myStoryRange As Microsoft.Office.Interop.Word.Range For Each myStoryRange In doc.StoryRanges With myStoryRange.Find .Text = "###field###&quo
View Complete Post