Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

naylynn

@naylynn
About
Posts
6
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to change Font in Word by C#
    N naylynn

    Thanks

    C# graphics csharp com help tutorial

  • How to change Font in Word by C#
    N naylynn

    Hello Every Body!
    I just try to text analysis program by C# .In the program i uses RichTextEdit . I want to load word file, text file , pdf to Richtext Edit Box. Now i can load these file to RichText Edit . But i can't change font these text. Just i used Microsoft.Office.Interop.Word; . Check my code below. Thanks for your kindness!

    public void ReadMsWord()
    {
    // variable to store file path
    string filePath=null;
    // open dialog box to select file
    OpenFileDialog file= new OpenFileDialog();
    // dilog box title name
    file.Title="Word File";
    // set initial directory of computer system
    file.InitialDirectory= "c:\\";
    // set restore directory
    file.RestoreDirectory= true;
    // execute if block when dialog result box click ok button
    if (file.ShowDialog() ==DialogResult.OK)
    {
    // store selected file path
    filePath=file.FileName.ToString();
    }
    try
    {
    // create word application
    Microsoft.Office.Interop.Word.Application word =new Microsoft.Office.Interop.Word.Application();
    // create object of missing value
    object miss= System.Reflection.Missing.Value;
    // create object of selected file path
    object path=filePath;
    // set file path mode
    object readOnly= false;
    //Microsoft.Office.Interop.Word.Font f = new Microsoft.Office.Interop.Word.Font();
    //f.Name = "Zawgyi-One, 8.25pt";
    //object fo = f;
    // open document
    Microsoft.Office.Interop.Word.Document docs=word.Documents.Open(ref path, ref miss, ref readOnly, ref miss, ref miss, ref miss, ref miss, ref miss,ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss);
    // select whole data from active window document
    docs.ActiveWindow.Selection.WholeStory();
    // handover the data to cllipboard
    docs.ActiveWindow.Selection.Copy();
    // clipboard create reference of idataobject interface which transfer the data
    IDataObject data= Clipboard.GetDataObject();
    //Microsoft.Office.Interop.Word.Range rng = docs.Paragraphs[1].Range;
    //rng.Font.Name = "Zawgyi-One";
    //set data into richtextbox control in text format
    richTextBox1.Text=data.GetData(DataFormats.Text).ToString();
    //word.Selection.Font.Name = "Zawgyi-One";
    // Microsoft.Office.Interop.Word.Document document = new Microsoft.Office.Interop.Word.Document();
    // this.richTextBox1.SelectAll();
    //System.Drawing.Font currentFont = richTextBox1.SelectionFont;
    // richTextBox1.SelectionFont = new System.Drawing.Font(currentFont.FontFamily,currentFont.Size,newFontStyle);
    // read bitmap image from clipboard with help of iddataobject interface
    Image img= (Image)data.GetData(DataFor

    C# graphics csharp com help tutorial

  • How to upload pdf file from sql to C#
    N naylynn

    Thanks friend

    C# help csharp database tutorial learning

  • datatype in DataGridview
    N naylynn

    how to divided cell in Datagrid view. My code is don't work in fraction number. Someone advise me. Thanks you all.

    foreach (DataGridViewRow row in this.dataGridView1.Rows)
    {
    int R1 = row.Index;
    for (b = 0; b < dataGridView2.ColumnCount; b++)
    {
    a = 0;
    for (c = 0; c < dataGridView2.RowCount; c++)
    {
    Ans_Grid.Rows[R1].Cells[b].Value =
    (((Double.Parse(dataGridView1.Rows[R1].Cells[c].Value.ToString()))
    * (Double.Parse(dataGridView2.Rows[c].Cells[b].Value.ToString())))).ToString()
    ;
    Ans_Grid.Rows[R1].Cells[b].Value = a + Convert.ToInt16(Ans_Grid.Rows[R1].Cells[b].Value);
    a = Convert.ToDouble(Ans_Grid.Rows[R1].Cells[b].Value);

    C# c++ database tutorial

  • How to upload pdf file from sql to C#
    N naylynn

    Thanks friend! I was thinking this way. But I have no idea "How do this method "Example--- How store pdf file to SQl.. and how retrieve pdf file to C#... You can teach me-- how write this

    C# help csharp database tutorial learning

  • How to upload pdf file from sql to C#
    N naylynn

    Hey Every Body! How do you do! I'm beginner of C# language. Now i want to save pdf file to sql and retrieve from there via C#. Someone could help me for this problem :) .. Thanks for every thing

    C# help csharp database tutorial learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups