- private void responsewrite()
- {
- StringBuilder strscript = new StringBuilder();
- strscript.Append(" <script language =/"vbscript/">/r/n");
- strscript.Append("Set myDocApp = CreateObject(/"Word.Application/")/r/n");
- strscript.Append("myDocApp.Visible = True/r/n");
- strscript.Append(" myDocApp.Activate/r/n");
- strscript.Append("set myDoc = myDocApp.Documents.Open(/"http://localhost:1507/Web/AppModules/SPJG/Annex/00/2008/12/30/20081230144112380.doc/")/r/n");
- strscript.Append("dim water/r/n");
- strscript.Append("water = /"备案号:/" + chr(13) + /"Q3301Q807757-2005/" + chr(13) + /"有效期至/" + /"2008年10月22日/"/r/n");
- strscript.Append("myDocApp.ActiveDocument.Shapes.AddTextbox(1, 63.85, 53.85, 265.85, 30).Select/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.TextFrame.TextRange.Select/r/n");
- strscript.Append("myDocApp.Selection.Collapse/r/n");
- strscript.Append(" myDocApp.Selection.TypeText(/"备案号:Q3301Q807757-2005/")/r/n");
- strscript.Append("myDocApp.Selection.ShapeRange.Fill.Visible = True/r/n");
- strscript.Append("myDocApp.Selection.ShapeRange.Fill.Solid/r/n");
- strscript.Append("myDocApp.Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255)/r/n");
- strscript.Append("myDocApp.Selection.ShapeRange.Fill.Transparency = 1/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.Line.DashStyle = 1/r/n");
- strscript.Append("myDocApp.Selection.ShapeRange.Line.Style = 1/r/n");
- strscript.Append("myDocApp.Selection.ShapeRange.Line.Transparency = 0/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.Line.Visible = False/r/n");
- strscript.Append(" myDocApp.ActiveDocument.Sections(1).Range.Select/r/n");
- strscript.Append(" myDocApp.ActiveWindow.ActivePane.View.SeekView = 9 /r/n");
- strscript.Append(" myDocApp.Selection.HeaderFooter.Shapes.AddTextEffect(msoTextEffect1, water, /"宋体/", 1, False, False, 0, 0).Select/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.Name = /"msoTextEffect1/"/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.TextEffect.NormalizedHeight = False/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.TextEffect.FontBold = True/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.Line.Visible = False/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.Fill.Visible = True/r/n");
- strscript.Append("myDocApp.Selection.ShapeRange.Fill.Solid/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 25, 100)/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.Fill.Transparency = 0 /r/n");
- strscript.Append("myDocApp.Selection.ShapeRange.Rotation = 355 /r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.LockAspectRatio = True/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.Height = 50 /r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.Width = 300 /r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.WrapFormat.AllowOverlap = True/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.WrapFormat.Side = 3 /r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.WrapFormat.Type = 3/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.RelativeHorizontalPosition = 0 /r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.RelativeVerticalPosition = 0/r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.Left = 70 /r/n");
- strscript.Append(" myDocApp.Selection.ShapeRange.Top = 190 /r/n");
- strscript.Append(" myDocApp.ActiveWindow.ActivePane.View.SeekView = 0 /r/n");
- strscript.Append(" function cancel()/r/n");
- strscript.Append("On Error Resume Next/r/n");
- strscript.Append(" myDocApp.Quit()/r/n");
- strscript.Append(" self.close()/r/n");
- strscript.Append(" end function/r/n");
- strscript.Append("</script>");
- Response.Write(strscript);
- }
word 加水印C#
最新推荐文章于 2023-05-10 21:10:25 发布