Click here to Skip to main content
15,917,321 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Can I create a water mark using C#.net for every page. Right now I am getting it only for one page, but I need to get this watermark on every page.
Can any body help?
I'll show my code which works for only one page:

    Word.Shape logoWatermark = null;
    oRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
     Word.Application headerApp = oDoc.Sections[1].Headers[Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages].Application;
logoWatermark = headerApp.ActiveDocument.Shapes.AddTextEffect(Microsoft.Office.Core.MsoPresetTextEffect.msoTextEffect1, textBox4.Text, "Arial", (float)60, Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoFalse, 0, l, ref oMissing);
                                    logoWatermark.Select(ref oMissing);
                                    logoWatermark.Fill.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;
                                    logoWatermark.Line.Visible = Microsoft.Office.Core.MsoTriState.msoFalse;
                                    logoWatermark.Fill.Solid();
                                    logoWatermark.Fill.ForeColor.RGB = (Int32)Word.WdColor.wdColorGray05;
                                    logoWatermark.RelativeHorizontalPosition = Word.WdRelativeHorizontalPosition.wdRelativeHorizontalPositionMargin;
                                    logoWatermark.RelativeVerticalPosition = Word.WdRelativeVerticalPosition.wdRelativeVerticalPositionMargin;
                                    logoWatermark.Left = (float)Word.WdShapePosition.wdShapeCenter;
                                    logoWatermark.Top = (float)Word.WdShapePosition.wdShapeCenter;
                                    logoWatermark.Height = oWord.InchesToPoints(1f);
                                    logoWatermark.Width = oWord.InchesToPoints(6f);
                                    oWord.ActiveWindow.ActivePane.View.SeekView = Word.WdSeekView.wdSeekMainDocument;

here i want the information about the watermark in the text docment, i had seen that in the watermark in the images but it contains lot of difference , which we are going to use in the text doc
plesae give me the information about the textdoc
Posted
Updated 3-May-11 1:53am
v3

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900