please help - need help on identifying last word in document 
Author Message
 please help - need help on identifying last word in document

Hello-

I'm attempting to write code that will delete a page if the last word
matches a variable I create.

For example, I create a variable called "LastWord" & dim that variable
to be equal to "Norway".  Then, if "Norway" is the last word on a
page, it will delete that entire page.

I've tried a few different methods with no luck.

Thanks for any tips/suggestions,

Brehmie



Fri, 14 May 2004 16:26:57 GMT  
 please help - need help on identifying last word in document
Hi Brehm

try this

If ActiveDocument.Range.Words.Last.Text = "Norway" Then
    'do that you need to do.
End If

--
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:
> Hello-

> I'm attempting to write code that will delete a page if the last word
> matches a variable I create.

> For example, I create a variable called "LastWord" & dim that variable
> to be equal to "Norway".  Then, if "Norway" is the last word on a
> page, it will delete that entire page.

> I've tried a few different methods with no luck.

> Thanks for any tips/suggestions,

> Brehmie



Fri, 14 May 2004 16:51:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

2. HELP: Need help identifying DLLs with version,date,size etc

3. Identifying the last paragraph mark or last break on a page

4. word document in VB form - Please Help

5. HELP PLEASE - Embedding Word document in VB?

6. Uploading a Word document to VB6 - Help Please!

7. Uploading a Word document in VB - Help Please!

8. Uploading a Word document in VB6 - Help Please!

9. Need HELP Importing Access List Box data to Word document

10. Need help with an Existing Word document

11. Need a help to close a word document using VB script

12. Need a help to close a word document using VB script

 

 
Powered by phpBB® Forum Software