Consulting

Results 1 to 2 of 2

Thread: Strikethrough on Header Number

  1. #1
    VBAX Contributor
    Joined
    Jun 2014
    Posts
    107
    Location

    Strikethrough on Header Number

    I've got a header number that I need to be able to strike through. I'm using a range and would like to access the strikethrough field for the header number but I can't out how to do it. This does work:
    oRng.Paragraphs(1).SelectNumber
    Selection.Font.StrikeThrough = true
    But I'd rather not use "selection". Anyone have an idea on how to do this?

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,334
    Location
    heedaf,

    When you post code, please post code that will compile!

    Sub ScratchMacro()
    'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 7/21/2017
    Dim oRng As Range
      Set oRng = ActiveDocument.Paragraphs(1).Range
      oRng.Characters.Last.Font.StrikeThrough = True
    lbl_Exit:
      Exit Sub
    End Sub
    Greg

    Visit my website: http://gregmaxey.com

Posting Permissions

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