Save Questionnaire (C #) in Word or in SQL server

-3

I have the following questionnaire, which I did in C #, it is a test that is done to new people.

What I would like to do would be to save the entire document in Word, say to have a backup of each person who performs the test, so you can print it at a time when you need to see the results of a certain person.

I hope I have been explicit with what I intend to do.

Greetings Thank you.

    
asked by Ezequie Lopez 27.06.2018 в 19:45
source

1 answer

0

Hi Many thanks to all for your response, I managed to move to a Word document, using the following code.

object ObjMiss = System.Reflection.Missing.Value;
            word.Application objWord = new word.Application();
            string ruta = Application.StartupPath + @"\Examen Karosso.docx";
            object parametro = ruta;
            word.Document objDoc = objWord.Documents.Open(parametro, ObjMiss);
            object fecha1 = "Fecha";
            word.Range Fech = objDoc.Bookmarks.get_Item(ref fecha1).Range;
            Fech.Text = dateTimePicker1.Text;
            object rango1 = Fech;
            objWord.Visible = true;
            objDoc.Bookmarks.Add("fecha", ref rango1);
            objDoc.Activate();
            objWord.Selection.Font.Color = word.WdColor.wdColorBlack;
            objWord.Selection.TypeText(Convert.ToString(textBox1.Text + "\r\n"));

The Which creates a document in Word to be able to store it and send it to print. Greetings and Thanks.

    
answered by 29.06.2018 в 19:36