In my app, I have a text box that takes the text and transfers it to w Word doc for printing. It does this with the bookmark feature in Word.
On the Word doc, I only have "X" amount of space. The bookmark in Word will auto size and fill with as much text as I want, but I need to limit this, and only have (for example) up to 900 characters in that specific bookmark. The remainder of the text I need to go to a seperate sheet.
Here is the (stripped down) code I use to transfer the text to the Word doc as an illistration:
Public Sub printPC_Affidavit() Dim oWord As Word.Application Dim oDoc As Word.Document oWord = CreateObject("Word.Application") oWord.Visible = True oDoc = oWord.Documents.Add(x.myPC_AffidavitDOTFile) oDoc.Bookmarks.Item("txtOffense1").Range.Text = frmPC_Affidavit.txtOffense1.Text oDoc.Bookmarks.Item("txtOffense2").Range.Text = frmPC_Affidavit.txtOffense2.Text oDoc.Bookmarks.Item("txtPC").Range.Text = frmPC_Affidavit.txtPC.Text oWord.PrintPreview = True ' print preview mode oWord = Nothing oDoc = Nothing GC.Collect() End Sub
So the bookmark in Word is called txtPC. I'll have to create another template in Word, and in it create another bookmark (that I'll call) txtPC2 or something.
So how do I get any characters over the 900 over to the second template?