Click here to Skip to main content
15,896,285 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a button for export to excel

so when i click that button..it should display excel file download dialogue box having options...

save,cancel,open...

that what i want to implement..

All the functionality are working fine...except that pop up download dialogue...
in window application.
Posted
Updated 6-Jun-12 22:51pm
v2
Comments
Abhinav S 7-Jun-12 4:51am    
Bold tags removed.

1 solution

Use this Code ......
C#
try
{
    Microsoft.Office.Interop.Word.ApplicationClass wordObject = new Microsoft.Office.Interop.Word.ApplicationClass();
    //object File = @"C:\Documents and Settings\admin\My Documents\Visual Studio 2008\Projects\JyoBussinessApplication\JyoBussinessApplication\solvent_letterhead.doc";
    object File = @"C:\Documents and Settings\admin\My Documents\Visual Studio 2008\Projects\JyoBussinessApplication\JyoBussinessApplication\VinayakaEnterprise_letterhead.docx";
    object nullobject = System.Reflection.Missing.Value;


    //object nullobject = System.Reflection.Missing.Value;
    Microsoft.Office.Interop.Word.Application wordobject = new Microsoft.Office.Interop.Word.Application();
    wordobject.DisplayAlerts = Microsoft.Office.Interop.Word.WdAlertLevel.wdAlertsNone;
    Microsoft.Office.Interop.Word._Document docs = wordObject.Documents.Open(ref File, ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject);

    //  docs.ActiveWindow.Selection.WholeStory();
    // docs.ActiveWindow.Selection.Copy();
}
catch
{

}
 
Share this answer
 
v3

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