G
Guest
I need to open a Word template so that I can merge some data from a database
with the document. I am using ASP.NET, VB.NET. I can not even get MS Word to
be visible. I can see that an instance is created in Task Manager.
Here is my code:
Private Sub createReport()
Dim missing As Object = System.Reflection.Missing.Value
Dim file_name As String
Dim file_path As String
Dim file_title As String
Dim word_server As Word.ApplicationClass
Dim sFile As String
sFile = context.Request.PhysicalApplicationPath &
"ScreeningReport.dot"
word_server = New Word.Application
word_server.Visible = True
'''word_server.ChangeFileOpenDirectory(file_path)
word_server.Documents.Open( _
FileName:=sFile, _
ConfirmConversions:=False, _
ReadOnly:=False, _
AddToRecentFiles:=False, _
PasswordDocument:="", _
PasswordTemplate:="", _
Revert:=False, _
WritePasswordDocument:="", _
WritePasswordTemplate:="", _
Format:=Word.WdOpenFormat.wdOpenFormatAuto, Visible:=True)
word_server.Selection.GoTo( _
What:=Word.WdGoToItem.wdGoToBookmark, _
Name:="clientname")
word_server.Selection.TypeText( _
Text:="<Here is the bookmark>")
word_server.Visible = True
End Sub
Why can I not even see the document in the browser?
Also, I have created this using the version of Crystal Reports that comes
with Visual Studio 2003. I have read that it is not re-distributable and is a
trial version. Is this true?
Thanks,
enak
with the document. I am using ASP.NET, VB.NET. I can not even get MS Word to
be visible. I can see that an instance is created in Task Manager.
Here is my code:
Private Sub createReport()
Dim missing As Object = System.Reflection.Missing.Value
Dim file_name As String
Dim file_path As String
Dim file_title As String
Dim word_server As Word.ApplicationClass
Dim sFile As String
sFile = context.Request.PhysicalApplicationPath &
"ScreeningReport.dot"
word_server = New Word.Application
word_server.Visible = True
'''word_server.ChangeFileOpenDirectory(file_path)
word_server.Documents.Open( _
FileName:=sFile, _
ConfirmConversions:=False, _
ReadOnly:=False, _
AddToRecentFiles:=False, _
PasswordDocument:="", _
PasswordTemplate:="", _
Revert:=False, _
WritePasswordDocument:="", _
WritePasswordTemplate:="", _
Format:=Word.WdOpenFormat.wdOpenFormatAuto, Visible:=True)
word_server.Selection.GoTo( _
What:=Word.WdGoToItem.wdGoToBookmark, _
Name:="clientname")
word_server.Selection.TypeText( _
Text:="<Here is the bookmark>")
word_server.Visible = True
End Sub
Why can I not even see the document in the browser?
Also, I have created this using the version of Crystal Reports that comes
with Visual Studio 2003. I have read that it is not re-distributable and is a
trial version. Is this true?
Thanks,
enak