File tree 1 file changed +4
-4
lines changed
Fields/Get-field-code/.NET/Get-field-code
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
- using Syncfusion . DocIO ;
1
+ using Syncfusion . DocIO ;
2
2
using Syncfusion . DocIO . DLS ;
3
3
using System ;
4
4
using System . IO ;
@@ -15,11 +15,11 @@ static void Main(string[] args)
15
15
// Load the template document.
16
16
using ( WordDocument document = new WordDocument ( fileStreamPath , FormatType . Docx ) )
17
17
{
18
- // Access the merge field in the first paragraph of the first section.
19
- WMergeField mergeField = document . Sections [ 0 ] . Paragraphs [ 0 ] . ChildEntities [ 2 ] as WMergeField ;
18
+ // Access the field in the first paragraph of the first section.
19
+ WField field = document . Sections [ 0 ] . Paragraphs [ 0 ] . ChildEntities [ 2 ] as WField ;
20
20
21
21
// Get and print the field code of the merge field.
22
- string fieldCode = mergeField . FieldCode ;
22
+ string fieldCode = field . FieldCode ;
23
23
Console . WriteLine ( fieldCode ) ;
24
24
}
25
25
}
You can’t perform that action at this time.
0 commit comments