Geeks With Blogs
Gaurav Taneja Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in.

public

{

Word.

 

void AddWatermark()Application wordApp = null;// applicationObject = application;

 

// object oname = applicationObject.GetType().InvokeMember("Name", BindingFlags.GetProperty, null, applicationObject, null);

 

{

wordApp = (Word.

}

 

{

Word.

doc.ActiveWindow.ActivePane.View.Type= Microsoft.Office.Interop.Word.

 

 

Word.

Word.

 

doc.Sections[1].Range.Select();

doc.ActiveWindow.ActivePane.View.SeekView = Word.

wmShape = mSelection.HeaderFooter.Shapes.AddTextEffect(Office.

wmShape.Select(

 

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader

Selection.HeaderFooter.Shapes.AddPicture(FileName:= "C:\25.jpg", LinkToFile:=False, SaveWithDocument:=True).Select*/

if (ThisApplication is Word.Application)Application)ThisApplication;if (wordApp != null)Document doc = wordApp.ActiveDocument;WdViewType.wdPrintView;Selection mSelection = wordApp.Selection;Shape wmShape;object anchor = Missing.Value;WdSeekView.wdSeekCurrentPageHeader;MsoPresetTextEffect.msoTextEffect1, "WaterMARK", "Times New Roman", 1, Office.MsoTriState.msoFalse, Office.MsoTriState.msoFalse, 0, 0, ref anchor);ref anchor);/*ActiveDocument.Sections(1).Range.Select

wmShape.Name =

wmShape.TextEffect.NormalizedHeight = Office.

wmShape.Line.Visible = Office.

wmShape.Fill.Visible = Office.

wmShape.Fill.Solid();

wmShape.Fill.ForeColor.RGB = (

wmShape.Fill.Transparency = 0.5f;

 

"PowerPlusWaterMarkObject1";MsoTriState.msoFalse;MsoTriState.msoFalse;MsoTriState.msoTrue;int)Word.WdColor.wdColorGray25;//wmShape.Rotation = 3.0f;

wmShape.LockAspectRatio = Office.

wmShape.Height = wordApp.InchesToPoints(0.82f);

wmShape.Width = wordApp.InchesToPoints(0.64f);

wmShape.WrapFormat.Side = Word.

wmShape.WrapFormat.Type = Word.

wmShape.RelativeHorizontalPosition = Word.

wmShape.RelativeVerticalPosition = Word.

wmShape.Left = (

wmShape.Top = (

doc.ActiveWindow.View.SeekView = Word.

 

 

MsoTriState.msoTrue;WdWrapSideType.wdWrapBoth;WdWrapType.wdWrapNone;WdRelativeHorizontalPosition.wdRelativeHorizontalPositionMargin;WdRelativeVerticalPosition.wdRelativeVerticalPositionMargin;float)Word.WdShapePosition.wdShapeCenter;float)Word.WdShapePosition.wdShapeTop;WdSeekView.wdSeekMainDocument;//rng.InsertFile("", ref Missing.Value, Missing.Value, Missing.Value, Missing.Value);

 

//wordApp.Selection.InlineShapes.AddPicture("C://dance.gif", ref false, ref true, ref doc.Paragraphs[2].Range);

}

Posted on Thursday, January 4, 2007 9:34 AM WaterMark | Back to top


Comments on this post: Adding Watermark on Word file(C#)

# re: Adding Watermark on Word file(C#)
Requesting Gravatar...
hi ,

here comes another solution on this issue.check
http://www.e-iceblue.com/Knowledgebase/Spire.Doc/Program-Guide/How-to-insert-a-watermark-into-Word.html

regards
Left by chirs on May 29, 2014 6:47 PM

Your comment:
 (will show your gravatar)


Copyright © Gaurav Taneja | Powered by: GeeksWithBlogs.net