Consulting

Results 1 to 3 of 3

Thread: Macro to ad a suffix to document title

  1. #1

    Post Macro to ad a suffix to document title

    Hi,

    I've recently begun to realise just how enormously useful macros can be, especially in my work as a translator/revisor. I've managed to make a few very simple ones for specific tasks, but mostly just using "record macro".

    What I'm currently looking for is a macro that, when activated:

    1) Turns on "track changes" if it is off (and preferably sets the display to "no markup", but that's optional)
    2) Saves a copy of the active document in the same directory as the active document, but with "_TC" added to the end of the document name.

    That's all. It would actually make my job a bunch easier, but this is a code-writing job and I'm afraid that's a skill that I don't quite have. Yet, I hope.

    I'd be grateful for any help!

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Try something based on:
    Sub MakeTC()
    Application.ScreenUpdating = False
    Dim StrName As String, StrExt As String, lFmt As Long
    With ActiveDocument
      .TrackRevisions = True
      .ShowRevisions = True
      With .ActiveWindow.View
        .ShowRevisionsAndComments = False
        .RevisionsView = wdRevisionsViewFinal
      End With
      StrName = .FullName:   lFmt = .SaveFormat
      StrExt = "." & Split(.Name, ".")(UBound(Split(.Name, ".")))
      StrName = Left(StrName, Len(StrName) - Len(StrExt))
        .SaveAs2 FileName:=StrName & "_TC" & StrExt, _
          Fileformat:=lFmt, AddToRecentFiles:=False
    End With
    Application.ScreenUpdating = True
    End Sub
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    That's perfect! Thanks loads

Posting Permissions

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