R
Red Herring
I have created a form for use at the office, but protecting the document
does not allow for field formatting.
So I need to created a button to either insert a bulleted list at the cursor
location, or apply a bulleted list to selected text (either or will do).
I tried creating a macro button, but all this succeeds in doing is creating
a bulleted list near the end of my document, where the button is... I assume
because the cursor location or higlighted text loses focus. Any suggestions
here.
I have several text fields, so the only option I can see currently is
putting a formatting toolbar for each form field. But there must be another
way.
Sub Selection_BulletList()
Selection_Unprotect
DocumentRange.ListFormat.ApplyBulletDefault
Selection_Protect
End Sub
Sub Selection_Unprotect()
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If
Set DocumentRange = Selection.Range
End Sub
Sub Selection_Protect()
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
DocumentRange.Select
End Sub
does not allow for field formatting.
So I need to created a button to either insert a bulleted list at the cursor
location, or apply a bulleted list to selected text (either or will do).
I tried creating a macro button, but all this succeeds in doing is creating
a bulleted list near the end of my document, where the button is... I assume
because the cursor location or higlighted text loses focus. Any suggestions
here.
I have several text fields, so the only option I can see currently is
putting a formatting toolbar for each form field. But there must be another
way.
Sub Selection_BulletList()
Selection_Unprotect
DocumentRange.ListFormat.ApplyBulletDefault
Selection_Protect
End Sub
Sub Selection_Unprotect()
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If
Set DocumentRange = Selection.Range
End Sub
Sub Selection_Protect()
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
DocumentRange.Select
End Sub