Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-10-2020, 09:43 PM
goddesslady goddesslady is offline Need Help! - with vba assignment? Windows 10 Need Help! - with vba assignment? Office 2019
Novice
Need Help! - with vba assignment?
 
Join Date: Jul 2020
Posts: 2
goddesslady is on a distinguished road
Unhappy Need Help! - with vba assignment?

I have a 300-word document, and I need to do the following in Word. Not sure which function to use-been googling and watching videos for hours!



- Bold the first word of every sentence
- Underline every 10th word in the writing sample, excluding the header
- Highlight every word in the writing sample that starts with a vowel in yellow
- Highlight every word in the writing sample that ends with a vowel in blue
- Highlight every word in the writing sample that both starts and ends with a vowel in green

Last edited by Charles Kenyon; 07-12-2020 at 12:48 PM.
Reply With Quote
  #2  
Old 07-11-2020, 09:59 AM
Charles Kenyon Charles Kenyon is offline Need Help! - with vba assignment? Windows 10 Need Help! - with vba assignment? Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 6,722
Charles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to behold
Default

There is no function built into Word that does what you want.

You will need to write a macro. That is write a macro, not record one.


"Header" or "heading?"
What is the difference between headings and headers?


I expect that you will get help with writing a macro here but you need to learn some concepts and vocabulary. Here are some starting places:
Reply With Quote
  #3  
Old 07-11-2020, 11:08 PM
Guessed's Avatar
Guessed Guessed is online now Need Help! - with vba assignment? Windows 10 Need Help! - with vba assignment? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,716
Guessed is a glorious beacon of lightGuessed is a glorious beacon of lightGuessed is a glorious beacon of lightGuessed is a glorious beacon of lightGuessed is a glorious beacon of light
Default

Sounds like a vba assignment. None of these items are particularly difficult but all will require a bit of research to learn some vba.

You should treat the first two as separate macros (both of which can be done in as few as three lines of code). The last three can be done in a more complicated macro and has a couple of different ways to approach the problem.

Some specific google searches that would help you work out macro 1 is:
VBA ActiveDocument.Sentences
VBA Font.Bold Range
VBA "For Each"

We can help once you have made an attempt at creating some macros and you post them here. The point of this is for you to learn...
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #4  
Old 07-12-2020, 01:35 PM
Charles Kenyon Charles Kenyon is offline Need Help! - with vba assignment? Windows 10 Need Help! - with vba assignment? Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 6,722
Charles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to behold
Default

If you start, we will be happy to help. I don't think anyone here is going to simply do what appears to be homework for you, though.
Reply With Quote
  #5  
Old 07-12-2020, 04:40 PM
goddesslady goddesslady is offline Need Help! - with vba assignment? Windows 10 Need Help! - with vba assignment? Office 2019
Novice
Need Help! - with vba assignment?
 
Join Date: Jul 2020
Posts: 2
goddesslady is on a distinguished road
Default

Thanks for your suggestion guys. This was an exam for a job I really needed. They only gave me 24 hours to do it, and I had no VBA experience. I'm in accounting-we don't usually do VBA, unless it's in excel... I ended up hiring someone from one of the forums to do it for me. Thanks for your suggestions.
Reply With Quote
  #6  
Old 07-12-2020, 04:52 PM
Guessed's Avatar
Guessed Guessed is online now Need Help! - with vba assignment? Windows 10 Need Help! - with vba assignment? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,716
Guessed is a glorious beacon of lightGuessed is a glorious beacon of lightGuessed is a glorious beacon of lightGuessed is a glorious beacon of lightGuessed is a glorious beacon of light
Default

Good luck with the job application.

We are happy to help you get up to speed on learning macros so that when you get the job, you have a few tricks in the toolkit. A good way to start is to read through these forums and experiment with code you find. Stepping through code written by the gurus here will give you a massive bank of useful knowledge.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #7  
Old 07-12-2020, 08:05 PM
Charles Kenyon Charles Kenyon is offline Need Help! - with vba assignment? Windows 10 Need Help! - with vba assignment? Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 6,722
Charles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to behold
Default

I agree with Andrew, however, if they want that vba skill level and you do not have it, you will be found wanting in your job if you do get it. You need to spend time learning quickly. People here will be willing to help, but we can't do your job for you. The macros you were asked to write took me a little over an hour. I would guess others here could do them in less. While I've seen much trickier problems, that one calls for some knowledge of the Word Object model and vba coding.

Grant Gamble has a couple of decent courses on Udemy that could help you quickly get up to speed.

If you have other programming experience, it will not be difficult. If you do not, you'll need to learn to think like a programmer. As programming languages go, vba is not that tough and has lots of tools to help you.

Word is not intuitive and programming it less so if you do not understand Word.
Here is a good book: Writing Word Macros: An Introduction to Programming Word using VBA: Steven Roman

Here is a good resource: Word Macros and Visual Basic for Applications (VBA) FAQ. Some of my previous links are from there.

Like Andrew, I hope your job application goes well.
Reply With Quote
Reply

Thread Tools
Display Modes


Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 08:58 PM.


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