Consulting

Results 1 to 3 of 3

Thread: WORD 365 URGENT HELP NEEDED!

  1. #1

    WORD 365 URGENT HELP NEEDED!

    I have a 300 word document and I need to write code to do the following:

    • 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

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,334
    Location
    This looks like a homework assignment but in any case this forum is not a free code writing service. If you want to learn VBA, there are plenty of people here willing to help. To get you started:

    Sub ScratchMacro()
    'A basic Word macro coded by Greg Maxey
    Dim oRng As Range
      Set oRng = ActiveDocument.Range
      With oRng.Find
        .Text = "<[AEIOUaeiou]*>"
        .MatchWildcards = True
        While .Execute
          oRng.Characters.First.HighlightColorIndex = wdYellow
          oRng.Collapse wdCollapseEnd
        Wend
      End With
    lbl_Exit:
      Exit Sub
    End Sub
    Greg

    Visit my website: http://gregmaxey.com

  3. #3
    Thank you. What do you suggest I do? This is a test for a job I really need; They gave me 24 hours to complete it and I have 4.5 hours left. I have NO EXPERIENCE doing VBAs. I had a friend help me with the first question- he couldn't figure the rest out, so he sent me here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •