1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Visual Basics, Word 2003, macros ... head scratch!

Discussion in 'Software Development' started by Redtronic, Apr 23, 2012.

Thread Status:
Not open for further replies.
  1. Redtronic

    Redtronic Thread Starter

    Apr 21, 2012
    Hi! Firstly I'd like to make it clear that I have absolutely no experience with Visual Basic in Word 2003 and therefore if anyone is able to help I would appreciate 'baby-fed instructions' ;)

    I have 3 shapes/groups in my document. I have used various macro's to manipulate the colour of all 3 groups, which therefore makes it easier for the user than having to select each group seperately and revise colour.

    My problem is that: the user has to be able to have the option to delete one(or more) of the shapes and continue to colour the remaining groups onstage. Currently I'm getting a "Run-time error" which states "The items with the specified name wasn't found". I expect I'll require some sort of "IF" statement?!!

    An extract of my script can be seen below:

    Sub BlackTopLenses()
    ' BlackTopLenses Macro
    ' Macro recorded 28/05/2012 by New User
        ActiveDocument.Shapes("Group 533").Select
        ActiveDocument.Shapes.Range(Array("Group 533", "Rectangle 522")).Select
        ActiveDocument.Shapes.Range(Array("Group 533", "Rectangle 522", _
            "Group 523")).Select
        Selection.ShapeRange.Fill.ForeColor.RGB = RGB(0, 0, 0)
        Selection.ShapeRange.Fill.Visible = msoTrue
    End Sub
    Any help would be greatly received... :D
  2. Rollin_Again


    Sep 4, 2003
    Can you post a sample document?

  3. panric


    May 7, 2012
    Hi,I suggest you switch to VB.NET. You can use interop to operate word. That is quite simple, but note that need MS word to be installed on.
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1050450