Monday, February 27, 2012
Thursday, August 4, 2011
Thursday, July 28, 2011
Wednesday, July 27, 2011
Friday, July 22, 2011
Tuesday, May 29, 2007
Published 11:51 PM by Aruna Jayathilaka with 0 comment
this is a usefull method to check spelling in testbox
//make all references
Microsoft Office 12.0 Object Library
Microsoft Word 12.0 Object Library
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Web.UI.WebControls;
using Microsoft.Office.Interop.Word;
public void SpellChecking(TextBox tBox)
{
try
{
Application app = new Application();
if (tBox.Text.Length > 0)
{
app.Visible = false;
object template = Missing.Value;
object newTemplate = Missing.Value;
object documentType = Missing.Value;
object visible = false;
object optional = Missing.Value;
_Document doc = app.Documents.Add(ref template, ref newTemplate, ref documentType, ref visible);
doc.Words.First.InsertBefore(tBox.Text);
ProofreadingErrors we = doc.SpellingErrors;
doc.CheckSpelling(ref optional, ref optional, ref optional,
ref optional, ref optional, ref optional, ref optional,
ref optional, ref optional, ref optional,
ref optional, ref optional);
object first = 0;
object last = doc.Characters.Count - 1;
tBox.Text = doc.Range(ref first, ref last).Text;
}
object saveChanges = false;
object originalFormat = Missing.Value;
object routeDocument = Missing.Value;
app.Quit(ref saveChanges, ref originalFormat, ref routeDocument);
}
catch (Exception ex)
{
//what ever u want to display on error
}
}
Read More
//make all references
Microsoft Office 12.0 Object Library
Microsoft Word 12.0 Object Library
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Web.UI.WebControls;
using Microsoft.Office.Interop.Word;
public void SpellChecking(TextBox tBox)
{
try
{
Application app = new Application();
if (tBox.Text.Length > 0)
{
app.Visible = false;
object template = Missing.Value;
object newTemplate = Missing.Value;
object documentType = Missing.Value;
object visible = false;
object optional = Missing.Value;
_Document doc = app.Documents.Add(ref template, ref newTemplate, ref documentType, ref visible);
doc.Words.First.InsertBefore(tBox.Text);
ProofreadingErrors we = doc.SpellingErrors;
doc.CheckSpelling(ref optional, ref optional, ref optional,
ref optional, ref optional, ref optional, ref optional,
ref optional, ref optional, ref optional,
ref optional, ref optional);
object first = 0;
object last = doc.Characters.Count - 1;
tBox.Text = doc.Range(ref first, ref last).Text;
}
object saveChanges = false;
object originalFormat = Missing.Value;
object routeDocument = Missing.Value;
app.Quit(ref saveChanges, ref originalFormat, ref routeDocument);
}
catch (Exception ex)
{
//what ever u want to display on error
}
}
Wednesday, May 9, 2007
Published 5:44 AM by Aruna Jayathilaka with 0 comment
prevent the browser window from going blank after a postback
and to maintain the correct control focus after events are processed.
smartnavigation="true"-----(2003)
MaintainScrollPositionOnPostback="true"----(2005)
Read More
and to maintain the correct control focus after events are processed.
smartnavigation="true"-----(2003)
MaintainScrollPositionOnPostback="true"----(2005)
Subscribe to:
Posts (Atom)