Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    St Georges du Bois, Pays de la Loire
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Go to a specific cell (Word 97 SP2)

    In a macro, is it possible to go to specific cell in a table without using a bookmark?

    I want to change the backgound colour of a cell when an e-mail action has been performed - to show that the e-mail has been sent.

    Word seems to allocate cell identifiers as in Excel: C1, D2 etc and uses them in calculations. Is it possible to send the cursor to say, cell C2, so that a change colour routine can run?

    If all else fails - can you hide the bookmark I-bar? Much to my surprise it does not dissappear when show codes is switched off.

  2. #2
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Go to a specific cell (Word 97 SP2)

    Not easily (that I know of). Suggestion - use Go to Table (you'll need to know what number the table is in the document) and then use cursors to go down and along as necessary.

    Anyone got a neater solution?

    And yes, you can hide the bookmark I-bar - in fact it is off by default - Tools, Options, View, Show - Bookmarks (uncheck, obviously).
    Beryl M


  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Go to a specific cell (Word 97 SP2)

    How are you defining the table? The following demonstrates colouring a cell in the first table in a document.
    <pre>With ActiveDocument.Tables(1).Cell(3, 2).Shading
    .Texture = wdTextureNone
    .ForegroundPatternColorIndex = wdAuto
    .BackgroundPatternColorIndex = wdRed
    End With</pre>

    ActiveDocument could be replaced with Selection if you wanted the currently selected table
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    Star Lounger
    Join Date
    Mar 2001
    Location
    St Georges du Bois, Pays de la Loire
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Go to a specific cell (Word 97 SP2)

    Thanks Andrew - exactly what I wanted and works well.

    David

Posting Permissions

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