Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 09-16-2014, 08:17 AM
Singh_Edm Singh_Edm is offline Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Windows 8 Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Office 2013
Advanced Beginner
Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1
 
Join Date: Jan 2014
Posts: 41
Singh_Edm is on a distinguished road
Default

Thanks!
Reply With Quote
  #17  
Old 09-16-2014, 09:11 AM
Singh_Edm Singh_Edm is offline Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Windows 8 Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Office 2013
Advanced Beginner
Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1
 
Join Date: Jan 2014
Posts: 41
Singh_Edm is on a distinguished road
Default

Hi macropod
I have 2 small issues.

1. I ran the code and got the following error: String parameter too long.
I clicked "debug" and the following line was highlighted.

.Replacement.Text = "^&-" & Split(Split(FRList, vbCr)(j), vbTab)(1)

It got stuck at the place where it had to insert meaning of a word whose length was 493 characters with spaces.

2. At some places in the document, the meanings are already inserted in blue after the red bracketed words. For e.g.

Australia is an awesome country. (Australia) (is) (an) (awesome) great, lovely, pleasant (country) (.)

Can a modification be made in the code so that when it is run and it finds the word (awesome), it inserts the meanings only if there is no text in blue immediately following the closing bracket.

Last edited by Singh_Edm; 09-16-2014 at 10:41 AM. Reason: Made my question clear.
Reply With Quote
  #18  
Old 09-16-2014, 02:10 PM
macropod's Avatar
macropod macropod is offline Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Windows 7 64bit Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
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

The first of those modifications would make the code run dramatically slower. Do you really need a 493-character definition?

As for the second issue, you could try changing:
.Text = "(" & Split(Split(FRList, vbCr)(j), vbTab)(0) & ")"
.Replacement.Text = "^&-" & Split(Split(FRList, vbCr)(j), vbTab)(1)
to:
.Text = "(" & Split(Split(FRList, vbCr)(j), vbTab)(0) & ") ("
.Replacement.Text = "(" & Split(Split(FRList, vbCr)(j), vbTab)(0) & ")-" & Split(Split(FRList, vbCr)(j), vbTab)(1) & " ("
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #19  
Old 09-16-2014, 02:18 PM
Singh_Edm Singh_Edm is offline Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Windows 8 Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Office 2013
Advanced Beginner
Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1
 
Join Date: Jan 2014
Posts: 41
Singh_Edm is on a distinguished road
Default

I will try your recommendation for the second issue soon while for the first issue if I know the maximum character limit that can be accommodated then I can take out the large definitions. What is the maximum character limit? Thanks
Reply With Quote
  #20  
Old 09-16-2014, 02:28 PM
macropod's Avatar
macropod macropod is offline Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Windows 7 64bit Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
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

IIRC, the limit is 255 characters for the total length of the expression. In this case, because the Find expression & brackets are part of the replacement expression, that has to be deducted from the 255 characters.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #21  
Old 09-16-2014, 10:47 PM
Singh_Edm Singh_Edm is offline Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Windows 8 Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Office 2013
Advanced Beginner
Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1
 
Join Date: Jan 2014
Posts: 41
Singh_Edm is on a distinguished road
Default

Yeah that worked! Thanks! That is so awesome. 1 small thing: Is there a quick way to insert a right square bracket ] after every bold word in a document?

I asked MS Word to find the bold word and replace with ^&] but it entered the ] after a tab.
Reply With Quote
  #22  
Old 09-16-2014, 11:12 PM
macropod's Avatar
macropod macropod is offline Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Windows 7 64bit Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
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 Singh_Edm View Post
Is there a quick way to insert a right square bracket ] after every bold word in a document?

I asked MS Word to find the bold word and replace with ^&] but it entered the ] after a tab.
Ordinarily you could do it using just Find/Replace using the same approach as before. In this case, it looks like you've already done that with the tab as the extra character to insert. Hence then tab is now part of the bolded range. So this time, along with setting the Find to look for a bold font, tell it to look for the tab as well, with:
^t
Then, for the Replace expression, use:
]^t
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #23  
Old 09-19-2014, 03:08 PM
Singh_Edm Singh_Edm is offline Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Windows 8 Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Office 2013
Advanced Beginner
Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1
 
Join Date: Jan 2014
Posts: 41
Singh_Edm is on a distinguished road
Default

Thank you very much

Last edited by Singh_Edm; 09-19-2014 at 03:23 PM. Reason: Acknowledged contribution.
Reply With Quote
Reply

Tags
macro find and replace, macro vba word, macros



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Find what box in Find and replace limits the length of a search term Hoxton118 Word VBA 7 06-10-2014 05:05 AM
Won't find in search ep2002 Word 3 10-31-2012 05:24 PM
Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 Macro that can find phrase and then find another and copy jperez84 Word VBA 10 09-19-2012 04:48 PM
Find a word in doc1, search for it in dictionary doc2, copy the meaning from doc 2 to doc 1 where we can find the meaning for all the marks that Word uses? Jamal NUMAN Word 2 06-26-2011 09:49 AM
Search Replace Copy dblack7211 Word 0 05-05-2010 01:19 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:13 AM.


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