Cloning a line of text

S

Simon

Hi all,

I have a search engine at work that will search the first
section of text in a word document among other things.

I want the search engine to find the subject and address
of a standard letter and so want to place this information
at the top of the word document in invisable text.
Currently I have to place this information in by copying
and pasting.
Is there any way that when I type with the cursor on the
particular line, that It appears in two places.

ie

Name Subject (extra text here) Tomorrows meeti

Dear Client

Regarding (type here) Tomorrows meeti

On behalf of .....

Thanks in advance
Simon
 
S

Steve

Hi Simon,

Hopefully this code snipet will help you

Dim rngSource As Word.Range
Dim rngDest As Word.Range

'Define rngSource to encapsulate source range.
'Define rngDest to be the insertion point of the destination.

'To include formatting
rngDest.FormattedText = rngSource.FormattedText

'To just insert text
rngDest.Text = rngSource.Text

~Smitch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top