erinbanister
New Member
- Joined
- Jun 19, 2013
- Messages
- 1
Hi All,
I’ve created a form for a user to insert boilerplate text into the header of a word document. However, I can’t seem to figure out how to load the form when the user needs it – I tried making it open when the user opens a new document, but that’s not working. Ideally, I’d like to be able to place a link in the quick links toolbar to allow users access when they need it. How do I do this?
Thanks for any help you can provide. Code is below.
I’ve created a form for a user to insert boilerplate text into the header of a word document. However, I can’t seem to figure out how to load the form when the user needs it – I tried making it open when the user opens a new document, but that’s not working. Ideally, I’d like to be able to place a link in the quick links toolbar to allow users access when they need it. How do I do this?
Thanks for any help you can provide. Code is below.
Code:
Option Explicit
Private Sub Document_New()
Choose_ITAR_Header.Show
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub ITAR_Click()
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Select
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Delete
Selection.TypeText Text:="ITAR Header "
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Unload Me
End Sub
Private Sub NoITAR_Click()
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Select
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Delete
Selection.TypeText Text:="No ITAR Header "
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Unload Me
End Sub