Add custom document properties word 2016
MatchAllWordForms = False End With Replace:=wdReplaceAll Dim i As Integer 'exit if no document is open If Documents.Count = 0 Then Exit Sub Application.ScreenUpdating = False 'Get page count i = ActiveDocument.BuiltInDocumentProperties(14) If i >= 1 Then 'Update fields in Footer ActiveDocument.Sections() _. Sub AutoOpen() 'set empty dates to N/A For c = 1 To curPropName = ActiveDocument.CustomDocumentProperties(c).Name If InStr(curPropName, "Transmittal_Name") Then curPropVal = ActiveDocument.CustomDocumentProperties(curPropName).Value curPropVal = Replace(curPropVal, "", "") End If If InStr(curPropName, "DueDate_RP") Or InStr(curPropName, "Header_form_Due_to_Document_Control") Or InStr(curPropName, "Header_form_Reference_Transmittal_Number") Or InStr(curPropName, "Header_form_WEC_Responsible_Person") Then 'MsgBox ("found one " + curPropName) curPropVal = ActiveDocument.CustomDocumentProperties(curPropName).Value 'if the user sets a blank date we set to N/A If curPropVal = "" Then ActiveDocument.CustomDocumentProperties(curPropName).Value = "N/A" End If End If Next c With Selection.Find.
Add custom document properties word 2016 code#
Here is the code (disclaimer- not a programmer, probably sloppy by most standards): The machine that displays the correct date, does not include the time. I put an alert in the macro to alert the values and I noticed the users who show the incorrect date show the raw value of the date is incorrect (behind 1 day) and shows the time as part of the date. List document properties in Table.zip 9.I recently found a bug where some users launch a word document (with the same source data) and for some users the date fields display correctly, where the others the date fields show the correct date - 1 day. From Word, press Alt + F8 to open the macro dialog box.Make sure the sound file is in the same folder as the document! (Or change path in code).Close VBE (Alt + Q or press the X in the top right hand corner).Paste the code there in the window at right.ConvertToTable Separator:=wdSeparateByTabs, _ '\\ Insert the string and covert it to a table
'\\ Set reference to start of document (range) STmp = sTmp & vbTab & oProp.Name & vbTab & oProp.Value '\\ Loop document properties and build tab delimeted stringįor Each oProp In ActiveDocument.BuiltInDocumentProperties '\\ To continue if a document property has no value set STmp = "Property Name" & vbTab & "Property Value" This way a author can check if all properties are filled in correct. This gives a quick look at all the document properties of the active document.
All document properties are listed in a table at the start of the document.