I'm looking to build a solution similar to this one: http://esqinc.com/section/products/4/idocid.html
What the system makes is insertion of a document file name into the document footer. How's that possible programmatically (preferably in .NET)?
Hoping this gets you started. The following pseudo c# code can be used to add text to footer. Only you will have to do this in a macro to completely automate this and also identify the document name to be added. Finally call in to the macro during Document Save to add the footer text.
foreach ( Section wordSection in wordDoc.Sections )
{
HeaderFooter footer = wordSection.Footers[ Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary ];
footer.Range.Select( );
footer.Range.Text = footerTxt;
hf.Range.Font.Size = 10;
wordApp.Selection.Paragraphs[ 1 ].Alignment = WdParagraphAlignment.wdAlignParagraphLeft;
wordApp.Selection.Paragraphs[ 1 ].SpaceAfter = 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With