A
Associates
Hi,
I'm having difficulty in assigning value from a textbox to DOCPROPERTY. In
the document, i have { DOCPROPERTY companyname } set in the header and {
DOCPROPERTY issuedate } in the footer. There are a few pages whose header and
footer linked together (same as previous).
Here is the code i have the problem with
With ActiveDocument
.BuiltInDocumentProperties("bi_compheader") = txtCompanyName.Text
.BuiltInDocumentProperties("bi_issuedate") = txtIssueDate.Text
End With
call updateFooter
call updateHeader
Sub UpdateFooter()
Dim i As Integer
'Get page count
i = ActiveDocument.BuiltInDocumentProperties(14)
If i >= 1 Then 'Update fields in Footer
ActiveDocument.Sections(ActiveDocument.Sections.Count) _
.Footers(1).Range.Fields.Update
End If
End Sub
Sub UpdateHeader()
Dim i As Integer
'Get page count
i = ActiveDocument.BuiltInDocumentProperties(14)
If i >= 1 Then 'Update fields in Header
ActiveDocument.Sections(ActiveDocument.Sections.Count) _
.Headers(1).Range.Fields.Update
End If
End Sub
Your helps are greatly appreciated
Thank you in advance
I'm having difficulty in assigning value from a textbox to DOCPROPERTY. In
the document, i have { DOCPROPERTY companyname } set in the header and {
DOCPROPERTY issuedate } in the footer. There are a few pages whose header and
footer linked together (same as previous).
Here is the code i have the problem with
With ActiveDocument
.BuiltInDocumentProperties("bi_compheader") = txtCompanyName.Text
.BuiltInDocumentProperties("bi_issuedate") = txtIssueDate.Text
End With
call updateFooter
call updateHeader
Sub UpdateFooter()
Dim i As Integer
'Get page count
i = ActiveDocument.BuiltInDocumentProperties(14)
If i >= 1 Then 'Update fields in Footer
ActiveDocument.Sections(ActiveDocument.Sections.Count) _
.Footers(1).Range.Fields.Update
End If
End Sub
Sub UpdateHeader()
Dim i As Integer
'Get page count
i = ActiveDocument.BuiltInDocumentProperties(14)
If i >= 1 Then 'Update fields in Header
ActiveDocument.Sections(ActiveDocument.Sections.Count) _
.Headers(1).Range.Fields.Update
End If
End Sub
Your helps are greatly appreciated
Thank you in advance