Putting textbox on a picture
how to link the picture as a template? and how to edit it with a textbox? pls help using C# codes in visual studio big thanks to all of you
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Amit Ziv35 pointsPosted Apr 22, 2014, 2:01 AM EDT
mackie duenas15 pointsPosted Apr 23, 2014, 6:14 PM EDT
mackie duenas15 pointsPosted Apr 23, 2014, 6:28 PM EDT
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Word = Microsoft.Office.Interop.Word;//<- this is what I am talking about namespace generateletter { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { // create offer letter try { // Just to kill WINWORD.EXE if it is running killprocess("winword"); // copy letter format to temp.doc File.Copy("C:\\OfferLetter.doc", "c:\\temp.doc", true); // create missing object object missing = Missing.Value; // create Word application object Word.Application wordApp = new Word.ApplicationClass(); // create Word document object Word.Document aDoc = null; // create & define filename object with temp.doc object filename = "c:\\temp.doc"; // if temp.doc available if (File.Exists((string)filename)) { object readOnly = false; object isVisible = false; // make visible Word application wordApp.Visible = false; // open Word document named temp.doc aDoc = wordApp.Documents.Open(ref filename, ref missing,ref missing, ref missing); aDoc.Activate(); // Call FindAndReplace()function for each change this.FindAndReplace(wordApp, "<Date>", dtpDate.Text); this.FindAndReplace(wordApp, "<Name>", txName.Text.Trim()); this.FindAndReplace(wordApp, "<Subject>", txtSubject.Text.Trim()); // save temp.doc after modified aDoc.Save(); } elseMessageBoxIcon.Information); killprocess("winword"); } catch (Exception) { MessageBox.Show("Error in process.", "Internal Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void FindAndReplace(Word.Application wordApp,{ object matchCase = true; object matchWholeWord = true; object matchWildCards = false; object matchSoundsLike = false; object matchAllWordForms = false; object forward = true; object format = false; object matchControl = false; object read_only = false; object visible = true; object replace = 2; object wrap = 1;