Hi macropod,
It works, thanks a million. I placed the line near the beginning as you said...
Sub FileSave()
Dim strfName
Call Document_ContentControlOnExit(ActiveDocument.SelectContentControlsByTitle("Visit Date - To")(1), False)
With ActiveDocument
If Len(.Path) = 0 Then
strfName = .ContentTypeProperties("RO").Value & Chr(32) & _
.CustomDocumentProperties("OfficeType").Value & Chr(32) & _
.ContentTypeProperties("Country(s)").Value & Chr(32) & _
.ContentControls(1).Range.Text & Chr(32) & _
.CustomDocumentProperties("ReportType").Value
.BuiltInDocumentProperties("Title").Value = strfName
With Dialogs(wdDialogFileSaveAs)
.Name = strfName & ".docx"
.Show
End With
Else
.Save
End If
End With
End Sub
May I bother you with two further issues that I came across:
1. If the user has made a mistake in filling out the fields on the document information panel and the file has already been saved once, the macro no longer updates the Title field with any new values (I guess because of...
Is it possible for the macro to always perform this check and update (if needed) before resuming with regular saves.
2. Is it possible for the user to receive a message when two dates match or the From date is greater than the To date etc. At the moment the field in error shows 'on' for matching dates and "" for from > to and to < from. My may concern is that it's possible to Save the file with incorrect dates. The columns in the sharepoint library show blanks where the dates have been entered in error.
Kind regards,
JDS_916