[RESOLVED] Info From User Form to Header
First let me say that I wouldn't even call myself a beginner. I am finding my way by following coding examples from many different sources.
Is it possible to transfer the information from a user form to the body of the document and to headers?
I have tried it using bookmarks in the headers and also by using a combination of bookmarks and headers. Neither works.
As an example, here is the code I used when trying to use bookmarks:
Code:
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("ABTTitle").Range.InsertBefore ABTTitle
.Bookmarks("ABTRevision").Range.InsertBefore ABTRevision
.Bookmarks("ABTNumber").Range.InsertBefore ABTNumber
End With
UserForm1.Hide
End Sub
Private Sub UserForm_Click()
End Sub
Thank you for any help you can give me.
Re: Info From User Form to Header
VBA question moved to Office Development
Re: Info From User Form to Header
try something like
vb Code:
With ActiveDocument
.Bookmarks("ABTTitle").Range.InsertBefore ABTTitle
.Bookmarks("ABTRevision").Range.InsertBefore ABTRevision
.Bookmarks("ABTNumber").Range.InsertBefore ABTNumber
.sections(1).headers(1).range.text = textbox3.text
End With
not tested, there are 3 headers in each section of the document