View Single Post
 
Old 06-11-2019, 10:30 AM
wolfgrrl wolfgrrl is offline Windows 10 Office 2010
Novice
 
Join Date: May 2019
Posts: 15
wolfgrrl is on a distinguished road
Default

I've got this code working now.

Code:
Private Sub Document_New()
Application.ScreenUpdating = False
Dim InvNum As String
With ThisDocument
  InvNum = .CustomDocumentProperties("InvNum") + 1
  .CustomDocumentProperties("InvNum") = InvNum
  '.Save
End With
With ActiveDocument
  'Update the value stored in the document property
  .CustomDocumentProperties("InvNum") = InvNum
  'Update the fields in the document
  .Fields.Update
End With
Application.ScreenUpdating = True
ActiveDocument.FormFields("ECNNUM").Result = InputBox("Please enter the ECN number. ")
ActiveDocument.Fields.Update
End Sub
I've tried to add this code to force a "Save As" on document_new, but the last place I used this code was on document_open.

Code:
 With Application.Dialogs(wdDialogFileSaveAs)
    .Name = "c:\My Documents\SaveExample.docm"
    .Format = wdFormatXMLDocumentMacroEnabled
    .Show
Is there code that will force a save such as this that will work in document_new? This is the very last step to getting this template to functions as I'd like.

Thank you for all your assistance!
Reply With Quote