Jfp87
11-14-2014, 12:39 AM
Guys,
Can anyone see a problem with this particular snippet of code? (Word 2010)
Case "Subject"
For N = 1 To 8
For P = 1 To 4
If strFileName = arrDoc(N) & " (" & P & ")" & ".docx" Then
cc.Range.Text = arrSub(N, P)
Exit For
Exit For
End If
Next P
Next N
arrSub(1, 1) = frmSubHeadings.txtRisk1.Value
arrSub(1, 2) = frmSubHeadings.txtRisk2.Value
arrSub(1, 3) = frmSubHeadings.txtRisk3.Value
arrSub(1, 4) = frmSubHeadings.txtRisk4.Value
...
etc.
"Subject" is the only content control within my document which won't update. When the code is run, the cc doesn't get populated with an empty string - it just remains as the original document property placeholder text. I am wondering if there is a glaring error which I have missed.
Cheers,
Joe
Can anyone see a problem with this particular snippet of code? (Word 2010)
Case "Subject"
For N = 1 To 8
For P = 1 To 4
If strFileName = arrDoc(N) & " (" & P & ")" & ".docx" Then
cc.Range.Text = arrSub(N, P)
Exit For
Exit For
End If
Next P
Next N
arrSub(1, 1) = frmSubHeadings.txtRisk1.Value
arrSub(1, 2) = frmSubHeadings.txtRisk2.Value
arrSub(1, 3) = frmSubHeadings.txtRisk3.Value
arrSub(1, 4) = frmSubHeadings.txtRisk4.Value
...
etc.
"Subject" is the only content control within my document which won't update. When the code is run, the cc doesn't get populated with an empty string - it just remains as the original document property placeholder text. I am wondering if there is a glaring error which I have missed.
Cheers,
Joe