Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub InsertUserName()
Dim oSection As Section
Dim oFoot As HeaderFooter
Dim oFld As Field
Dim UserField As Boolean
For Each oSection In ActiveDocument.Sections
For Each oFoot In oSection.Footers
If Not oFoot.LinkToPrevious Then
With oFoot.Range
UserField = False
For Each oFld In .Fields
If oFld.Type = wdFieldUserName Then UserField = True
Next
If UserField = False Then
.Select
With Selection
If Trim(.Range.Text) <> "" Then
.Collapse (wdCollapseEnd)
.TypeText Chr(11)
End If
.Fields.Add Range:=Selection.Range, Type:=wdFieldUserName
End With
End If
End With
End If
Next
Next
End Sub
With Selection
.EndKey Unit:=wdStory
.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = _
.Sections(1).Footers(wdHeaderFooterPrimary) _
.Range.Text & Environ("Username")
End With