accessing word document through using word com object 
Author Message
 accessing word document through using word com object

 I wanted to open word file through using Word com object. For this i
referenced word com object in my project then I wrote the following code on
button click event.
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)   Handles Button1.Click
        Dim a As Word.Application
        Dim b As Word.Document
        a = New Word.Application()
        b = New Word.Document()
        a.Documents.Open(filename:="c:\n.doc", Visible:=True)
    End Sub

 but at run time it gives me following error on line "a= new
  An unhandled exception of type 'System.UnauthorizedAccessException'
occurred in controls.exe Additional information: Access is denied.

 To solve this problem run "dcomcnfg.exe" untility and set identity property
of microsoft word doucment as the "interactive user". I also set default
access permission in default security
i.e. i click on edit permission and add those user who run .net application
and set type of access as Allow access. then also set default launch
permission and default confinguarion permission as similar to default access

 But still it gives the same error.

Wed, 15 Sep 2004 17:34:32 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Query on a Word document using the Word object

2. opening and closing word document using vb,net

3. Opening and Saving MS Word Documents using VB.NET

4. Using VB.Net to Generate MS Word Documents

5. Trouble Opening a Word Document with VB.NET,Open member not found in Documents

6. Edit Access OLE object Word document from VB 3

7. VB.Net using a Word doc object - copying in text w/ a hard return

8. Printing documents in Word using COM

9. Word objects from Acces via VB6 to WORD document

10. Object to load a word document into for display in

11. Using Find in a Word document from Access freezes Access

12. Cutting a full Word document and pasting it in another Word Document


Powered by phpBB® Forum Software