Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-15-2014, 10:37 AM
awolf awolf is offline First word of sentence IF and then Windows 8 First word of sentence IF and then Office 2013
Novice
First word of sentence IF and then
 
Join Date: Mar 2014
Posts: 3
awolf is on a distinguished road
Default First word of sentence IF and then


Please help. My brain is exhausted.

Here is what I am trying to accomplish:

I need 1 command that incorporates 5 rules that I can execute with 1 macro to any word document.

The rules relate to lists of words, which I have in excel.

Rule 1:

Add number lines to the document.

Rule 2: (Column A in excel)

1)Find specific words (column A) 2) highlight those words only 3)IF they are at the beginning 4)OR end of a sentences within the document, 5) 4)add phrase after the highlight "Does not meet writing standard."

I will then manually save the document and send it to a person to correct the highlight, 5)meaning the highlight can be removed.

Rule 3:

1)Find specific words (column c in excel) 2) highlight those words only 3)IF they are at the beginning 4)OR end of a sentences within the document. 4)add the alternative word (column d) in 5)blue

Rule 4:

1)Find specific words (column f in excel) 2) highlight those words only 3)IF they are at the beginning 4)OR end of a sentences within the document. 4)add the alternative word (column f) in 5)Green

Rule 5:

Insert a front page 2) Message: The following errors were noted in this document in 3)font color purple and 4) font size 14. Below the message 5) a table with 6)two columns that in includes 7)line number and row two 8)references

Rule 6:

Once I save the document and send it to the individual they are able to edit as normal.

Any help would be greatly appreciated.
Attached Files
File Type: xlsx Word List.xlsx (9.6 KB, 8 views)
Reply With Quote
  #2  
Old 03-15-2014, 03:40 PM
fumei fumei is offline First word of sentence IF and then Windows 7 64bit First word of sentence IF and then Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

I am confused. If the words are in Excel
Quote:
The rules relate to lists of words, which I have in excel.
it may be better to do things in Excel, then produce a document after.
Quote:
Rule 1:

Add number lines to the document
Do you mean numbered lines.
Quote:
Rule 2: (Column A in excel)

1)Find specific words (column A) 2) highlight those words only 3)IF they are at the beginning 4)OR end of a sentences within the document, 5) 4)add phrase after the highlight "Does not meet writing standard."
So you are highlighting them in Excel. Or are you highlighting them in some Word document. If in Word, what document.

Please try and describe in better detail.
Reply With Quote
  #3  
Old 03-15-2014, 07:12 PM
macropod's Avatar
macropod macropod is offline First word of sentence IF and then Windows 7 32bit First word of sentence IF and then Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

awolf: You need to be aware that Word VBA's notion of what constitutes a sentence isn't what most readers would consider a sentence. For example, consider the following:

Mr. Smith spent $1,234.56 at Dr. John's Grocery Store, to buy: 10.25kg of potatoes; 10kg of avocados; and 15.1kg of Mrs. Green's Mt. Pleasant macadamia nuts.

For you and me, that would probably count as one sentence; for VBA it counts as 5... This could have significant implications for your rules 2, 3 & 4.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 03-15-2014, 09:26 PM
awolf awolf is offline First word of sentence IF and then Windows 8 First word of sentence IF and then Office 2013
Novice
First word of sentence IF and then
 
Join Date: Mar 2014
Posts: 3
awolf is on a distinguished road
Default

I apologize if I did not explain well.

I am using Excel to store singular words. The words in the column are what I want the Word Document to use to identify.

So when I run the code, MS Word will reference the words from Excel.

Kind Regards,
Reply With Quote
  #5  
Old 03-15-2014, 09:50 PM
macropod's Avatar
macropod macropod is offline First word of sentence IF and then Windows 7 32bit First word of sentence IF and then Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For code to use an Excel to store a word list for Find/Replace operations, see: https://www.msofficeforums.com/word-...d-replace.html. Compared to the approach there, it seems you'll need to either keep the workbook open while processing or create multiple find arrays in Word, one for each of your rules 2, 3 & 4.

As indicated in my previous post, though, you're liable to have problems implementing your rules 2, 3 & 4.

It's also not clear how you propose to do the line numbering. Word has an automatic line numbering feature you could use. However, you also need to be aware that what appears on one line on your PC could be on a different line on another PC. That's because Word uses information from the active printer to determine the page formatting. And, of course, if one inserts a 'front page message', that could mess up the line numbering unless a Next page Section break is used and line numbering on the first page is disabled.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 03-16-2014, 12:02 PM
awolf awolf is offline First word of sentence IF and then Windows 8 First word of sentence IF and then Office 2013
Novice
First word of sentence IF and then
 
Join Date: Mar 2014
Posts: 3
awolf is on a distinguished road
Default

Paul,

Does that take into account word count and Line count in Word?

Thank you very much for the information.

Just a quick brain storm - is it possible to import each sentence into Excel or is that the same problem.

Kind Regards,
Amy
Reply With Quote
  #7  
Old 03-16-2014, 01:16 PM
fumei fumei is offline First word of sentence IF and then Windows 7 64bit First word of sentence IF and then Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

Quote:
is it possible to import each sentence into Excel
I really think you need to be clear and specific and answer questions posed to you, which you are not doing. Are you taking source of words in Excel....or not. The above quote seems you are now talking about having a source in some Word document, and moving things to Excel.
Reply With Quote
  #8  
Old 03-16-2014, 02:40 PM
macropod's Avatar
macropod macropod is offline First word of sentence IF and then Windows 7 32bit First word of sentence IF and then Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by awolf View Post
Does that take into account word count and Line count in Word?
This is your first reference to word count. How is that relevant? As for the line count, I don't know what more you want than what I've already said.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
combine rules, macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
Append text to a sentence containing specific word dgp Word VBA 3 02-28-2014 10:38 PM
Find/Replace, Duplicating a word in a sentence to hundreds of sentences. DDDD Word 0 10-08-2013 10:48 AM
lost space sentence word 2010 in 2007 rahmat Word 2 09-17-2013 06:17 PM
Space Between Each Sentence dazwm Word 2 10-17-2012 04:19 AM
I want to lock a sentence in Word smorkette Word 1 02-06-2010 12:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft