Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Christoph Hilmes
 
Posts: n/a
Default Extract text from a word-document in rtf-format without using the clipboard

Hi NG,

i have an application using vb and word. I control word from within my
vb-application using vba. At one point i extract the text of a document in
rtf format (with all the rtf-commands) and put it into a string-variable.
Then i replace parts of the text using a string-search-and-replace-
algorithm. Afterwards i paste the text back into the word-document so that
the formatting is not lost. To achieve that i use the windows-clipboard.

To get the text out of the document:

Select_Text pos_beginn, pos_end
Clipboard.Clear
wordobj.Selection.Cut
text = Clipboard.GetText(vbCFRTF)

To paste it back into the document

Clipboard.Clear
Clipboard.SetText "{" & text_ein & "}", vbCFRTF
Select_Text pos_beginn, pos_end
wordobj.Selection.Range.Paste

That works pretty well on most systems. But with certain configurations
(most of all terminal-server-emulations) i got problems using the
clipboard. Therefore i search for another solution for my problem without
using the clipboard.

Can anybody help me here?

Thanks in advance.

Christoph
VB 6
Word 2000
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please give us REVEAL CODES like WORD PERFECT not reveal codes in. Rachel King Microsoft Word Help 38 August 21st 09 09:54 PM
Making Word do something that Wordperfect can do NarniaUK New Users 4 May 1st 05 10:44 PM
Envelope Address GR New Users 5 April 24th 05 09:48 PM
Locking Two Words Together to Make a Proper Compound Noun in Word WorkingWoman Microsoft Word Help 2 April 7th 05 02:33 PM
Wordperfect Office 2000 conversion to Word 2003 MikeE New Users 1 March 21st 05 12:04 AM


All times are GMT +1. The time now is 04:17 AM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"