Unterschrift

Aus Thomas Wiki
Zur Navigation springen Zur Suche springen

Auch wenn es in MS Office oder LibreOffice einen Überarbeitungsmodus gibt, ist es manchmal nötig, eine Unterschrift mit dem aktuellen Datum in ein Dokument einzufügen.

Hier werden für die verschiedenen Produkte Lösungen des Problems angeboten.

Lotus Notes Formula Language

Die folgende Lotus Notes Formel fügt das Datum und den Namen an der Stelle des Cursors in ein Dokument ein, das zum Editieren geöffnetes ist. (Formel in einem SmartIcon in einer Symbolleiste definieren.)

tmpDate:=@Now;
sDate:=@Right("00"+@Text(@Day(tmpDate));2) + "."+ @Right("00"+@Text(@Month(tmpDate));2) + "." + @Text(@Year (tmpDate)) ;
@Command([TextSetFontFace]; "Comic Sans MS");
@Command([TextSetFontColor];[Blue]);
@Command([EditInsertText]; @NewLine + sDate + " - Mein Name")

Microsoft Word

Einfügen eines blauen Textbaustein "dd.mm.yy - MeinName" in ein MS Word Dokument.

Tipp: Als Makro auf einen Icon legen.

Sub Unterschrift()

  MyUserName = Application.UserName
 
  With Selection
    .TypeParagraph
    OldColor = .Font.Color
    .Font.Color = wdColorBlue
    .InsertDateTime DateTimeFormat:="dd.MM.yy", InsertAsField:= _
    False, DateLanguage:=wdGerman, CalendarType:=wdCalendarWestern, _
    InsertAsFullWidth:=False
    .TypeText Text:=" - " & MyUserName
    .Font.Color = OldColor
  End With
   
End Sub

MS Excel

Dieses Makro hängt an den Kommentar einer Zelle um Datum und Nutzer. Nützlich um Änderungen ohne Änderungsmodus mit Datum zu verfolgen. Ist kein Kommentar vorhanden, wird ein Kommentar hinzugefügt.

Unterschrift als Kommentar zum selektierten Bereich

Sub UnterschriftComment()

  With Selection.Cells(1, 1)
   
    If .Comment Is Nothing Then
   
      .AddComment
      .Comment.Visible = True
      .Comment.Text Text:=Application.UserName & " - " & Format(Now(), "dd.mm.yy") & ":"
    Else
      .Comment.Text Text:= .Comment.Text & Chr(10) & "---" & Chr(10) & _
                           Application.UserName & " - " & Format(Now(), "dd.mm.yy") & ":"
    End If
   
  End With

End Sub

Unterschrift in selektierten Feld

Sub Unterschrift()

 With Selection
  .NumberFormat = "@"
  .Value = Format(Now(), "dd.mm.yy") & " - " & Application.UserName
 End With

End Sub