How to write into a .doc (Word) file in c#?

private void MakeDoc(object fileMain, string number)
{
Microsoft.Office.Interop.Word.ApplicationClass WordApp = new Microsoft.Office.Interop.Word.ApplicationClass();

object nullobj = System.Reflection.Missing.Value;

WordApp.Visible = false;

Microsoft.Office.Interop.Word.Document doc = WordApp.Documents.Open(
ref fileMain, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj);

doc.Activate();

FindAndReplace(WordApp, "", number);

object fileOutput = Directory.GetCurrentDirectory() + @"\K.doc";
doc.SaveAs(ref fileOutput, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj);

doc.Close(ref nullobj, ref nullobj, ref nullobj);
WordApp.Quit(ref nullobj, ref nullobj, ref nullobj);

Functions.OpenFile(fileOutput.ToString());
}

private void FindAndReplace(Microsoft.Office.Interop.Word.Application WordApp, object findText, object replaceWithText)
{
object matchCase = true;
object matchWholeWord = true;
object matchWildCards = false;
object matchSoundsLike = false;
object nMatchAllWordForms = false;
object forward = true;
object format = false;
object matchKashida = false;
object matchDiacritics = false;
object matchAlefHamza = false;
object matchControl = false;
object read_only = false;
object visible = true;
object replace = 2;
object wrap = 1;

WordApp.Selection.Find.Execute(ref findText,
ref matchCase, ref matchWholeWord, ref matchWildCards,
ref matchSoundsLike, ref nMatchAllWordForms, ref forward,
ref wrap, ref format, ref replaceWithText, ref replace,
ref matchKashida, ref matchDiacritics, ref matchAlefHamza,
ref matchControl);
}

How to change mouse curser?

this.Cursor = Cursors.WaitCursor;

....

this.Cursor = Cursors.Default;

C# double count of digits after point?

Convert.ToSingle(myValue).ToString("N2");

How to copy a folder to new location in c# recursively?

public void CopyFolder(string sourceFolder, string destFolder)
{
if (!Directory.Exists(destFolder))
Directory.CreateDirectory(destFolder);

string[] files = Directory.GetFiles(sourceFolder);
string[] folders = Directory.GetDirectories(sourceFolder);

foreach (string file in files)
{
string name = Path.GetFileName(file);
string dest = Path.Combine(destFolder, name);
File.Copy(file, dest);
}

foreach (string folder in folders)
{
string name = Path.GetFileName(folder);
string dest = Path.Combine(destFolder, name);
CopyFolder(folder, dest);
}
}