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:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* 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
Go Back   Tech Support Forum > Microsoft Support > Microsoft Office support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Microsoft Office support MS Office support forum

Reply
 
LinkBack Thread Tools
Old 06-23-2009, 06:31 AM   #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
designingsally is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
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

Old 06-23-2009, 04:43 PM   #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:
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.
What exactly are you trying to do?
__________________
Cheers
macropod
(MS MVP -Word)
macropod is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-23-2009, 10:32 PM   #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
designingsally is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-24-2009, 12:40 AM   #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)
macropod is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-24-2009, 03:38 AM   #5 (permalink)
Registered User
 
Join Date: Jun 2009
Posts: 13
OS: Win xp


Re: Ms vba macro help-urgent

Quote:
Originally Posted by macropod View Post
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.


Thanks. I cracked it. Any idea abt preposition finder?
designingsally is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-24-2009, 04:55 AM   #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)
macropod is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-24-2009, 10:58 PM   #7 (permalink)
Registered User
 
Join Date: Jun 2009
Posts: 13
OS: Win xp


Re: Ms vba macro help-urgent

Quote:
Originally Posted by macropod View Post
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.
Hi Macropod

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
Attached Files
File Type: doc Prep Macro.doc (48.0 KB, 3 views)
designingsally is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-24-2009, 11:19 PM   #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:
there are two errors that is stopping me from running the program
There's a lot of code there, and I don't have any of the files referred to in:
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"
on my system to test with.

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)
macropod is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-25-2009, 08:16 AM   #9 (permalink)
Registered User
 
Join Date: Jun 2009
Posts: 13
OS: Win xp


Smile Re: Ms vba macro help-urgent

Quote:
Originally Posted by macropod View Post
Hi Sally,

OK, I can see the code in the document, but where are the errors occuring? You previously said:There's a lot of code there, and I don't have any of the files referred to in:
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"
on my system to test with.

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.
Hey Macropod

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
Attached Files
File Type: doc Table tracker.doc (44.5 KB, 1 views)
designingsally is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-25-2009, 09:15 AM   #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)
macropod is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-26-2009, 02:39 AM   #11 (permalink)
Registered User
 
Join Date: Jun 2009
Posts: 13
OS: Win xp


Re: Ms vba macro help-urgent

Quote:
Originally Posted by macropod View Post
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.
Thanks for the reply Macropod.

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
designingsally is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




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



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85