J
Jean-Guy Marcil
Leon_Amirreza was telling us:
Leon_Amirreza nous racontait que :
What are you trying to do?
From your description it looks like you want to transfer selected text in a
Word document to another document without using Copy/Paste and while
preserving the formatting.
If that is the case, lookup the FormattedText property of the Range object.
For example, to copy the current selection with its formatting to the fourth
paragraph in the same document:
Dim rgeCurrent As Range
Dim rgeTarget As Range
Set rgeCurrent = Selection.Range
Set rgeTarget = ActiveDocument.Paragraphs(4).Range
rgeTarget.FormattedText = rgeCurrent
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
Leon_Amirreza nous racontait que :
I need to access the Selected Text in RTF format and send RTF Text to
Word in a C# App.
I cant use Copy and Paste becuase it ruins the information user has
put in clipboard and more importantly becuase the program reads data
from a Database in RTF format and it would be weay tooo slow to paste
the data into word.
I dunno how to read from or write RTF text into a word document that
is already open in word?
What are you trying to do?
From your description it looks like you want to transfer selected text in a
Word document to another document without using Copy/Paste and while
preserving the formatting.
If that is the case, lookup the FormattedText property of the Range object.
For example, to copy the current selection with its formatting to the fourth
paragraph in the same document:
Dim rgeCurrent As Range
Dim rgeTarget As Range
Set rgeCurrent = Selection.Range
Set rgeTarget = ActiveDocument.Paragraphs(4).Range
rgeTarget.FormattedText = rgeCurrent
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org