Attribute VB_Name = "Module12"
Sub Obfuscate()

Dim prompt As String
Dim answer As String

prompt = "The Obfuscator will rename all task and resource names in this file." & vbCrLf & _
            "You should either obfuscate a backup copy of your project file or " & vbCrLf & _
            "save this file as a copy after the obfuscation (using Save As)." & vbCrLf & vbCrLf & _
            "Are you sure you wish to proceed?"
            
answer = MsgBox(prompt, vbYesNo, "Project Obfuscator")

If answer = vbNo Then
    Return
End If

nextTaskNum = 1
nextResourceNum = 1

For Each t In ActiveProject.tasks
    If Not t Is Nothing Then
        If t.ExternalTask = False Then
            t.Name = "Task " + Str(nextTaskNum)
            nextTaskNum = nextTaskNum + 1
            
            If t.Notes <> "" Then
                t.Notes = "Note was obfuscated"
            End If
            
            '
            'If Not t.Notes Is Nothing Then
            '    If t.Notes.Length > 0 Then t.Notes = "Note was obfuscated"
            'End If
        End If
    End If
Next t

For Each r In ActiveProject.Resources
    If Not r Is Nothing Then
        r.Name = "Resource " + Str(nextResourceNum)
        nextResourceNum = nextResourceNum + 1
    End If
Next r

MsgBox ("Obfuscation is complete.")
End Sub



