Hi there,
I need to copy several paragraphs of text from a word document upon the pressing of a button. This text is then pasted into a website, into a text box.
Due to the way paragraphs seem to work, when copying the last paragraph into the website text box, another line is inserted at the bottom, i.e. the last line of text is not the last line in the pasted into text box. - Hope that is clear -?
I think it is because the paragraph character has a trailing space included in it - ? Please could someone kindly tell me how to remove this last space or perhaps its a carriage return of some type - but I dont think so.
e.g pasted text last line
abcdefghijkl = last line of text in website text box
!cursor is here, where the ! mark is.
thank you if you can help...Sub Select_Paragraphs() Dim rngParagraphs As Range Set rngParagraphs = ActiveDocument.Range( _ Start:=ActiveDocument.Paragraphs(2).Range.Start, _ End:=ActiveDocument.Paragraphs(16).Range.End) rngParagraphs.Copy End Sub
You'd better not copy
Sub Select_Paragraphs() with activedocument c01 = .Range(.Paragraphs(2).Range.Start,.Paragraphs(16).Range.End) end with c01=left(c01,len(c01)-1)) 'object.text=c01 End Sub
Ahh, thank you, I haven't tried it yet, just worked it through on paper/my head, but I understand - many thanks!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks