here is what I am trying to do:
The file is supposed to save itself according to the user's input and even if there is an input at all. Meaning, if a user has not made any inputs yet, the IF-Statement should return the first part (thats why UserName = ""). But if a user had previously already entered something, I want it to return the second part of the IF-Statement.
The original name of the file is 20210910_Besprechungsnotizen_00_ and if Jack is the first person to open that document and create a protocol, the name is supposed to be: 20210910_Besprechungsnotizen_00_Jack and only asking for Jack's Name. If Jack wants Steve to go over this document, then word should realize, Jack already saved this document (entered his initials or his name) and it will ask Steve which version this document is currently being on and add Steve behind Jack. Meaning: 20210910_Besprechungsnotizen_01_JackSteve while Steve only entered his name and 1.
I am a newbie & your help is much appreciated! Here is my code:
Private Sub CommandButton3_Click()
Dim FilePath As String
Dim Filename As String
Dim MyDate As String
Dim UserName As String
If UserName = "" Then
FilePath = "//SRVDC\Arbeitsordner\Intern\Meetings\Entwürfe\"
MyDate = Format(Date, "YYYYMMDD")
Filename1 = "_Besprechungsnotizen_i_00_"
UserName = InputBox("Wer erstellt? (Name in Firmenkurzform)")
ActiveDocument.SaveAs2 FilePath & MyDate & Filename1 & UserName
Else
FilePath = "//SRVDC\Arbeitsordner\Intern\Meetings\Entwürfe\"
MyDate = Format(Date, "YYYYMMDD")
Filename1 = "_Besprechungsnotizen_i_0"
Filename2 = "_"
UserName = InputBox("Wer bearbeitet? (Name in Firmenkurzform)")
Version = InputBox("Welche Version? (in ganzen Zahlen)")
ActiveDocument.SaveAs2 FilePath & MyDate & Filename1 & Version & Filename2 & UserName
End If
End Sub
