![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Microsoft Office support MS Office support forum |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jun 2009
Posts: 13
OS: Win xp
|
Ms vba macro help-urgent
Hi guys,
I m lookin for help out here to write a vba macro code for microsoft word. I ll be extremely glad if anyone comes up with the coding of it in vba for ms word. 1. replace a word and highlight the replaced word 2. To highlight some important words in the document. The words can be changed from one document to another and the words to be highlighted should be users choice. Say for one project i can highlight words like "WORD" in a given document but i should be able to change the word as something else when the macros are run 3. Preposition checker. I wan VBA CODING FOR MS WORD that could check prepositions and mention some extra options. The extra options can be displayed in a messgae box or within the document itself. I will be extremely glad for those who ll help me out. Thanks a lot in advance regards sally |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) | |
|
TSF Enthusiast
Join Date: Apr 2008
Location: Australia
Posts: 549
OS: Vista
|
Re: Ms vba macro help-urgent
Hi Sally,
For 1 & 2 you can use Find/Replace to find all instances of a given word and format them with whatever attributes you want. No macros needed. For 3, your problem description is ambiguous: Quote:
__________________
Cheers macropod (MS MVP -Word) |
|
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Jun 2009
Posts: 13
OS: Win xp
|
Re: Ms vba macro help-urgent
Hi MacroPod
Thanks for your reply. Do you have the code to highlight the replaced text. I know how to find and replace a word or text but to highlight the replaced text i m unable to do so :( I ll be extremely glad if you can help me that. Well for the third problem, I have the coding for the preposition checker. But I m getting syntax error that I m unable to rectify it. I want a VBA coding for MS WORd that can check prepositions in a given document. If the preposition is wrongly used I want the macro to list an alternative for the incorrect prepositio. For example: Monkey is in the tree. Here, in is a preposition and it is wrong. I wan the macro to mark the word in and indicate the preposition on. I have the coding with me but there are two errors that is stopping me from running the program. If you got thoughts pls share it with me. Thanks a ton Cheers Sally |
|
|
|
|
|
#4 (permalink) |
|
TSF Enthusiast
Join Date: Apr 2008
Location: Australia
Posts: 549
OS: Vista
|
Re: Ms vba macro help-urgent
Hi Sally,
Enough with the replies already!!! For the Find/Replace: Insert the word you want to highlight in the Find box. Insert ^& in the Replace box Click on 'More' if the extra options aren't hightlighted With the Find box still selected, click on Format|Font Choose whatever font attribute you want Click OK, then start replacing Note: if you choose 'add' with bold hightlighting and the document has 'maddening' in it, you'll end up with 'maddening'. So, you'll probably need to choose the 'match whole words' option.
__________________
Cheers macropod (MS MVP -Word) |
|
|
|
|
|
#5 (permalink) | |
|
Registered User
Join Date: Jun 2009
Posts: 13
OS: Win xp
|
Re: Ms vba macro help-urgent
Quote:
Thanks. I cracked it. Any idea abt preposition finder? |
|
|
|
|
|
|
#6 (permalink) |
|
TSF Enthusiast
Join Date: Apr 2008
Location: Australia
Posts: 549
OS: Vista
|
Re: Ms vba macro help-urgent
Hi Sally,
Without seeing the code, and some idea of which lines its failing at, no. If you care to post the code I'll take a look at it. If you do post it, do use the HTML code tags so that it retains the original formatting.
__________________
Cheers macropod (MS MVP -Word) |
|
|
|
|
|
#7 (permalink) | |
|
Registered User
Join Date: Jun 2009
Posts: 13
OS: Win xp
|
Re: Ms vba macro help-urgent
Quote:
I am attaching the file with the macro, so that it will be useful for you to view. Thanks a ton again dude. Cheers Sally |
|
|
|
|
|
|
#8 (permalink) | |
|
TSF Enthusiast
Join Date: Apr 2008
Location: Australia
Posts: 549
OS: Vista
|
Re: Ms vba macro help-urgent
Hi Sally,
OK, I can see the code in the document, but where are the errors occuring? You previously said: Quote:
Code:
Const Root As String = "C:\Prepositions" Const perl As String = "C:\Perl\bin\perl.exe" Const perlScript As String = Root & "\prepwin2.pl" Const DoneFileLoc As String = Root & "\preposition.don" Const OutputFile As String = Root & "\outputFile.txt" Const TargetFile As String = Root & "\targets2.txt" Having said that, there's an obvious problem with your subroutine structure. 'Sub Prep()' (which doesn't actually seem to do anything) has no 'End Sub' statement (presumably required before 'Sub changeWordText(newWord As String)' and there are two 'End Sub' statements at the end of the code.
__________________
Cheers macropod (MS MVP -Word) |
|
|
|
|
|
|
#9 (permalink) | |
|
Registered User
Join Date: Jun 2009
Posts: 13
OS: Win xp
|
Quote:
Thanks for your reply. I have a document which has a table at the begining and below the table there is a paragraph. And now the user checks out errors and using the track changes options and makes the changes. As the user makes changes can the changes be updated in the table also. If so can you please tell me how to do it using macros. If you got some code or something pls share it. I ll be extremely grateful else give me steps to how to use record macro to fulfill this purpose. Thanks a ton dude... By the way, I have attached a document and I marked the errors in read. I think they are wrongly declared. I tired tweaking it but it does not seem to help out. Can you please help me out. Thanks Sally |
|
|
|
|
|
|
#10 (permalink) |
|
TSF Enthusiast
Join Date: Apr 2008
Location: Australia
Posts: 549
OS: Vista
|
Re: Ms vba macro help-urgent
Hi Sally,
What has the table tracker got to do with the problem we were working on? I'd rather work on one issue at a time, plus I'd suggest starting a new thread for whatever the problem is with the table tracker. I'm still waiting for you to provide the detail I've sought a couple of times now about what lines were generating the errors you reported with the preposition checking code.
__________________
Cheers macropod (MS MVP -Word) |
|
|
|
|
|
#11 (permalink) | |
|
Registered User
Join Date: Jun 2009
Posts: 13
OS: Win xp
|
Re: Ms vba macro help-urgent
Quote:
As you had highlighted previously, I dont have those files with me. Anyways I m opening a new thread on track tracker, as MS _WORD TABLE TRACKER. POst in your thoughts |
|
|
|
|
![]() |
| Thread Tools | |
|
|