Consulting

Results 1 to 20 of 81

Thread: How to change Date Picker content control format based on date comparison

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Hi macropod,

    I placed the line of code in my FileSave() macro and it works but only after the file has been saved first. When I click on save a second time, the fields change! I'm not sure if this is the best code for saving a file for the first time because it certainly does not work if the user decides to click on Save As instead of Save.


    Sub FileSave()
      Dim strfName
          With ActiveDocument
              If Len(.Path) = 0 Then
                  strfName = .ContentTypeProperties("RO").Value & Chr(32) & _
                  .CustomDocumentProperties("OfficeType").Value & Chr(32) & _
                  .ContentTypeProperties("Country(s)").Value & Chr(32) & _
                  .CustomDocumentProperties("ReportType").Value
                  .BuiltInDocumentProperties("Title").Value = strfName
               With Dialogs(wdDialogFileSaveAs)
                      .Name = strfName & ".docx"
                      .Show
                  End With
              Else
                  Call Document_ContentControlOnExit(ActiveDocument.SelectContentControlsByTitle("Visit Date - To")(1), False)
                  .Save
              End If
          End With
      End Sub

    Regards,

    JDS_916

    P.S I think the Save and Save As are both working now.
    Last edited by JDS_916; 03-17-2014 at 09:16 AM.

Posting Permissions

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