Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Hello all,

I am trying to edit an doc file using asp.net.
It successfully opens the file and edits it, but unable to close.

When I keep the cursor on the closing statement, aDoc.Close(ref missing, ref missing, ref missing);

it's showing error message something like give below

Ambiguity between method 'Microsoft.Office.Interop.Word._Document.Close(ref object,ref object,ref object,)' and non-method Microsoft.Office.Interop.Word.Document.Events2.Event.Close. Using method Group

Please help how to fix it.

Thanks
Posted
Updated 16-Mar-11 22:24pm
v2
Comments
Albin Abel 17-Mar-11 3:44am    
Are you using open or _open for opening the document?
Dipesh Gupta 17-Mar-11 4:03am    
no.........
Dalek Dave 17-Mar-11 4:25am    
Edited for Grammar and Readability.

 
Share this answer
 
Comments
Dipesh Gupta 17-Mar-11 4:04am    
Thanks........ my problem is solved........
Albin Abel 17-Mar-11 4:07am    
You are welcome
Dalek Dave 17-Mar-11 4:25am    
Good Call!
raju melveetilpurayil 17-Mar-11 6:30am    
good link --- my 5
Albin Abel 17-Mar-11 7:34am    
Thanks Raju.m makhaai
Try this one :-

((Microsoft.Office.Interop.Word._Document)aDoc).Close(ref missing, ref missing, ref missing);
 
Share this answer
 

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