PDA

View Full Version : comma Paste problem in word



Warex
07-08-2006, 09:17 PM
Hello,
I have came across an issue using paste I do not understand.
I have a text box that I am copying the contents and want to past into a table in a word document. However when ever I paste it, it onlys paste's text before a comma. All text after a comma never gets pasted.

The text in the text box is actual text typed by the user like two or three paragraphs wich comas are used for puctuation. So if I cannot paste commas, it kinda defeats the purpose. This is really perplexing me...
Anyone have an idea on this?
:banghead:
the code I am using is as follows:


Private Sub copypasteit()
Dim MyData As DataObject
Set MyData = New DataObject
Documents.Open "c:\225\225.doc"
TextBox1.SelStart = 0
TextBox1.SelLength = TextBox1.TextLength
TextBox1.Copy
If Documents(1).Tables.Count >= 1 Then
Documents(1).Tables(6).Range.Paste
End If
End Sub

mdmackillop
07-09-2006, 11:39 AM
Try

Private Sub copypasteit()
Documents.Open "c:\225\225.doc"
If Documents(1).Tables.Count >= 1 Then
Documents(1).Tables(6).Range.InsertAfter TextBox1
End If
End Sub

Warex
07-09-2006, 01:08 PM
That was it!:rotlaugh:

Out of curiousity, why can I not get commas to work with the other method?

Either way thanks, I can rest my head and fix the hole in the wall!

:thumb