Click here to Skip to main content
15,888,019 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Error comes after publishing vb.net application which writes data in MS Word
Posted
Comments
Prerak Patel 10-Jun-11 7:22am    
Elaborate more. Put some relevant code, error message or event log if possible.
thatraja 10-Jun-11 8:01am    
Not clear, Include all details(error messages, etc.,)
Dave Kreskowiak 10-Jun-11 9:26am    
From the OP:

This is the code which simply creates option button in word document. after publishing code it gives me error as
Cannot create ActiveX component.


Dim MyWordDoc As Microsoft.Office.Interop.Word.Application

Dim dcpath As String


Dim Option1 As Microsoft.Office.Interop.Word.InlineShape


MyWordDoc = CreateObject("word.application")

dcpath = Server.MapPath("~//TEST.docx")

MyWordDoc.Documents.Open(dcpath)

MyWordDoc.Selection.MoveDown(, 3)

With MyWordDoc

Option1 = .Selection.InlineShapes.AddOLEControl(ClassType:="Forms.OptionButton.1")
With Option1.OLEFormat.Object
.Caption = "TEST1"
.FontName = "Arial"
.FontSize = 10
.Width = 430

End With
End With

MyWordDoc.ActiveDocument.SaveAs("D:\" & "TEST_11.docx")
MyWordDoc.Documents.Close()
MyWordDoc.Documents.Open("D:\" & "TEST_11.docx")
Dave Kreskowiak 10-Jun-11 17:50pm    
What line throws the error?

It gives error for line "MyWordDoc = CreateObject("word.application")"
 
Share this answer
 
i have enconuter this error USING WORD 2010 IN THE CLIENT PC
 
Share this answer
 
Comments
[no name] 9-Apr-14 12:43pm    
And so? Is this really a solution to this 3 year old question

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900