B
Brian Harvey
I am working on creating a template of document used by several of my colleagues and I. What I have so far is a document outline saved as a .DOTM (using Word 2007). I have coded a screen to popup and ask a few piecese of information. My issue is that when I post the template on our SharePoint site and someone (even myself) pulls down the file and then opens it, the form pops, I fill it out and click ok and a new document based on the template is created and called Document1, but none of the fields are populated. If I go back and look at the template I pulled down again I see where all of the values were written to the template instead of the document created from the template. How can I fix this?
Private Sub cmdCreate_Click()
Dim strTitle As String
strTitle = txtARNumber.Text & " - " & txtARTitle.Text
ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle).Value = strTitle
ActiveDocument.Fields.Update
UpdateHeader
ActiveDocument.Bookmarks.Item("ARNUMBER").Range.Text = txtARNumber.Text
ActiveDocument.Bookmarks.Item("ARTITLE").Range.Text = txtARTitle.Text
ActiveDocument.Bookmarks.Item("ITSRNUMBER").Range.Text = txtITSRNumber.Text
ActiveDocument.Bookmarks.Item("AUTHOR").Range.Text = txtAuthor.Text
ActiveDocument.Bookmarks.Item("CREATEDATE").Range.Text = Format(Now, "MM/DD/YYYY")
Me.Hide
End Sub
Private Sub cmdCreate_Click()
Dim strTitle As String
strTitle = txtARNumber.Text & " - " & txtARTitle.Text
ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle).Value = strTitle
ActiveDocument.Fields.Update
UpdateHeader
ActiveDocument.Bookmarks.Item("ARNUMBER").Range.Text = txtARNumber.Text
ActiveDocument.Bookmarks.Item("ARTITLE").Range.Text = txtARTitle.Text
ActiveDocument.Bookmarks.Item("ITSRNUMBER").Range.Text = txtITSRNumber.Text
ActiveDocument.Bookmarks.Item("AUTHOR").Range.Text = txtAuthor.Text
ActiveDocument.Bookmarks.Item("CREATEDATE").Range.Text = Format(Now, "MM/DD/YYYY")
Me.Hide
End Sub