Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Ms Word generation from asp.net


Message #1 by "Henry" <henrywolfe@y...> on Wed, 28 Aug 2002 18:51:51
I am having problems with ms word and asp.net and I am not sure how to 
correct it. Below is some of my code. When the code hits the 
wdApp.Documents.Open(sSourcePath) line of code it errors out with a 

System.NullReferenceException: Object reference not set to an instance of 
an object 



Please help 



Imports Word.DocumentClass 

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles MyBase.Load 

GetDocument("C:\Documents\test.doc") 
End Sub 


Public Function GetDocument(ByVal sSourcePath) As String 

Dim wdApp As Word.Application 
Dim arrTags() As String 
Dim arrValues() As String 
Dim iLoop As Integer 

wdApp.Documents.Open(sSourcePath) 

End Function

  Return to Index