Using clipboard contents in FIND prompt. 
Author Message
 Using clipboard contents in FIND prompt.

I am attempting to create a macro that uses the find command to search
through a document.  How can I  search through the document using the
contents of the clipboard?  In the example below I would like to be able to
replace S104D5BM with whatever happens to be on the clipboard at the time.

    With Selection.Find
        .Text = "S104D5BM"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False

Thanks in advance for any help you can provide.

Dan Johnson



Mon, 07 Jul 2003 05:12:41 GMT  
 Using clipboard contents in FIND prompt.
Hi Dan,

Make this change

         .Replacement.Text = "^c"

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email


Quote:
> I am attempting to create a macro that uses the find command to search
> through a document.  How can I  search through the document using the
> contents of the clipboard?  In the example below I would like to be able
to
> replace S104D5BM with whatever happens to be on the clipboard at the time.

>     With Selection.Find
>         .Text = "S104D5BM"
>         .Replacement.Text = ""
>         .Forward = True
>         .Wrap = wdFindContinue
>         .Format = False
>         .MatchCase = False
>         .MatchWholeWord = False
>         .MatchWildcards = False
>         .MatchSoundsLike = False
>         .MatchAllWordForms = False

> Thanks in advance for any help you can provide.

> Dan Johnson



Mon, 07 Jul 2003 06:19:38 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Copying DBGrid contents to clipboard (Or copying a table from a Data component to clipboard)

2. Help for getting rid of the contents in clipboard(office) using VBA

3. Using clipboard contents in macro?

4. Using Clipboard Contents to Develop Filename and Save to Desktop

5. Clipboard object questions... using the clipboard with vb4

6. How to copy contents of control to clipboard?

7. content of the clipboard

8. Clearing the Clipboard Contents

9. Copy contents of a control to the clipboard

10. Attach contents of Clipboard

11. Restoring the clipboard content after PasteFace

12. Create buttons to store clipboard content in Word

 

 
Powered by phpBB® Forum Software