.Selection.Find.Execute in Email Type Word Document

S

Shinya

I am searching a word document for specific word.
when using selection.find.execute do i have to have
all document selected? (Ctrl+A) this works for
normal document, but when i have email type document
(display To: CC: Subject input box in word document to
send email from word )
vb says "this command is not available." and hight light
.Selection.Find.Execute line.

any idea why vb keeps poping up this message at
.Selection.Find.Execute line when using Email type
word document?

Shinya


dim wordDoc as word.appliaction
wordDoc.open(specific file)

With wordDoc

.Selection.ClearFormatting

With .Selection.Find
.Text = str_word
.Forward = True
'.Highlight = True
.Wrap = wdFindContinue
.format = False
.MatchCase = False
.MatchWholeWord = True
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
FindKeyword = .Selection.Find.Execute
 
C

Cindy M -WordMVP-

Hi Shinya,

Note that I have little idea about how having a document as
email might affect this, but here are a couple of things
you can pursue
- You might try with Range.Find instead of selection.
If the focus in the application is somewhere where using
.Find is not appropriate, that could be the reason for the
error message.
Dim rng as Word.Range
Set rng = activeDocument.Content.Range
With rng.Find
'etc.

- There's a known problem when automating Word for
.Find that's due to a conflict with an old Excel library
(same GUIDs). It's documented in the Knowledge Base. Note
that I don't think this is the problem you're encountering,
but I mention it for the sake of completeness.

If neither of these get you any further, you might try
asking in a group that specialized in Outlook programming.
The Outlook folks generally have a better idea of the
limitations imposed by email with Word as the editor.
I am searching a word document for specific word.
when using selection.find.execute do i have to have
all document selected? (Ctrl+A) this works for
normal document, but when i have email type document
(display To: CC: Subject input box in word document to
send email from word )
vb says "this command is not available." and hight light
.Selection.Find.Execute line.

any idea why vb keeps poping up this message at
.Selection.Find.Execute line when using Email type
word document?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
S

Shinya

Cindy,

Range worked!!
thanks a lot.

Shinya

Cindy M -WordMVP- said:
Hi Shinya,

Note that I have little idea about how having a document as
email might affect this, but here are a couple of things
you can pursue
- You might try with Range.Find instead of selection.
If the focus in the application is somewhere where using
Find is not appropriate, that could be the reason for the
error message.
Dim rng as Word.Range
Set rng = activeDocument.Content.Range
With rng.Find
'etc.

- There's a known problem when automating Word for
Find that's due to a conflict with an old Excel library
(same GUIDs). It's documented in the Knowledge Base. Note
that I don't think this is the problem you're encountering,
but I mention it for the sake of completeness.

If neither of these get you any further, you might try
asking in a group that specialized in Outlook programming.
The Outlook folks generally have a better idea of the
limitations imposed by email with Word as the editor.


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)


This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

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