Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello to every body. i want to generate word documents from my windows application. in windows application i created one button named generate, if i click it the one word document ll need to generate.

my code is:

C#
string StrContent = "<table border='0' style='margin-removed10px; margin-removed20px;' cellpadding='5' cellspacing='1'>";
StrContent += "<tr><td valign='top' bgcolor='#FFFFFF' style='font-weight: normal; font-family:" + "This is my first application" + "</td></tr>";
StrContent += "</table>";
            WebBrowser webbrowser1 = new WebBrowser();
            webbrowser1.DocumentText = StrContent;
            webbrowser1.Document.Title = "Question Papper";
            webbrowser1.Width = 1000;
            webbrowser1.ShowPrintDialog();


but i got an error as ERROR HRESULT E_FAIL has been returned form a cal to a com component

can any plz help me.

thanks in advance!
Posted
Updated 8-Feb-12 19:27pm
v3

1 solution

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