Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change bar macro (Word 2003)

    Hi,
    I've asked this question before and I'm back asking again. I wrote this maco in Word 2000, migrated it to Word 2002 and now to Word 2003. The problem is it only works on my computer and no one elses.
    Redline macro:
    Sub Redline()
    '
    ' Redline Macro
    ' Add change bar by turning tracking on then 'crtl x' the text and 'crtl v' back in
    '
    ActiveDocument.TrackRevisions = False
    Selection.Cut
    ActiveDocument.TrackRevisions = True
    Selection.Paste
    ActiveDocument.TrackRevisions = False

    End Sub

    A macro written in Word 2003:
    Sub NewRedline()
    '
    ' NewRedline Macro
    ' Macro recorded 9/7/2006 by ATK Thiokol
    '
    Selection.EndKey Unit:=wdLine, Extend:=wdExtend
    Selection.Cut
    ActiveDocument.TrackRevisions = Not ActiveDocument.TrackRevisions
    Selection.PasteAndFormat (wdPasteDefault)
    ActiveDocument.TrackRevisions = Not ActiveDocument.TrackRevisions
    End Sub

    The first macro works great, for me. The second macro will add a copy of the selected text to the document along with the original text. When I run a macro to remove the change bar both the old and the new text disappear.

    Can anyone explain why my macro doesn't work on anyone elses computer when it did under 2000 and 2002.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Change bar macro (Word 2003)

    I think it's worth noting that these two macros are different in ways that might matter. I've added some comments (and used With notation to shorten some of the longest lines):
    <pre>Sub Redline()
    ' Redline Macro
    ' Add change bar by turning tracking on then 'crtl x' the text and 'crtl v' back in
    With ActiveDocument
    .TrackRevisions = False 'Turn off revision tracking
    Selection.Cut 'Cut the current selection
    .TrackRevisions = True 'Turn on revision tracking
    Selection.Paste 'Paste from the clipboard
    .TrackRevisions = False 'Turn off revision tracking
    End With
    End Sub

    Sub NewRedline()
    ' NewRedline Macro
    ' Macro recorded 9/7/2006 by ATK Thiokol
    With ActiveDocument
    Selection.EndKey Unit:=wdLine, _
    Extend:=wdExtend 'Extend selection to end of line
    Selection.Cut 'Cut the current selection
    .TrackRevisions = Not .TrackRevisions 'Toggle revision tracking
    Selection.PasteAndFormat (wdPasteDefault) 'Special paste for table cells??
    .TrackRevisions = Not .TrackRevisions 'Toggle revision tracking
    End With
    End Sub</pre>

    Now, the first macro seems to work fine for me in Word 2003. If it doesn't work for others, what happens? If they are unable to run it, perhaps their macro permissions are too strict. If it doesn't have the intended effect, perhaps you can gather some sample documents for analysis.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change bar macro (Word 2003)

    What are and where do I find Macro permissions. Someone here at work suggested permission as the problem.

  4. #4
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change bar macro (Word 2003)

    The error they get now is: Could not open macro storage

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Change bar macro (Word 2003)

    > Could not open macro storage

    That one can have many causes, unfortunately. Did you supply a template or code to paste into Normal.dot?

  6. #6
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change bar macro (Word 2003)

    Actually I just had them use a copy of my Normal.dot in place of their original Normal.dot

Posting Permissions

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