开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 1273|回复: 12
收起左侧

[已解决] word对象

 关闭 [复制链接]
结帖率:61% (35/57)
发表于 2021-8-7 16:38:30 | 显示全部楼层 |阅读模式   广东省梅州市
10精币
易语言是怎么添加水印到word里面的呢。谢谢
    ActiveDocument.Sections(1).Range.Select
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.HeaderFooter.Shapes.AddTextEffect( _
        PowerPlusWaterMarkObject8163454, "保密1", "等线", 1, False, False, 0, 0). _
        Select
    Selection.ShapeRange.Name = "PowerPlusWaterMarkObject8163454"
    Selection.ShapeRange.TextEffect.NormalizedHeight = False
    Selection.ShapeRange.Line.Visible = False
    Selection.ShapeRange.Fill.Visible = True
    Selection.ShapeRange.Fill.Solid
    Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
    Selection.ShapeRange.Fill.Transparency = 0.5
    Selection.ShapeRange.Rotation = 315
    Selection.ShapeRange.LockAspectRatio = True
    Selection.ShapeRange.Height = CentimetersToPoints(5.9)
    Selection.ShapeRange.Width = CentimetersToPoints(14.75)
    Selection.ShapeRange.WrapFormat.AllowOverlap = True
    Selection.ShapeRange.WrapFormat.Side = wdWrapNone
    Selection.ShapeRange.WrapFormat.Type = 3
    Selection.ShapeRange.RelativeHorizontalPosition = _
        wdRelativeVerticalPositionMargin
    Selection.ShapeRange.RelativeVerticalPosition = _
        wdRelativeVerticalPositionMargin
    Selection.ShapeRange.Left = wdShapeCenter
    Selection.ShapeRange.Top = wdShapeCenter
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

最佳答案

查看完整内容

[e=0].版本 2 局_Word对象.获取 (“word.Application”) ' ActiveDocument.Sections(1).Range.Select 局_ActiveDocument = 局_Word对象.读对象型属性 (“ActiveDocument”, ) 局_Sections = 局_ActiveDocument.读对象型属性 (“Sections”, ) 局_Sections.读对象型属性 (“Item”, 1).读对象型属性 (“Range”, ).方法 (“Select”, ) ' ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader 局_Word对象.读对象 ...

回答提醒:如果本帖被关闭无法回复,您有更好的答案帮助楼主解决,请发表至 源码区 可获得加分喔。
友情提醒:本版被采纳的主题可在 申请荣誉值 页面申请荣誉值,获得 1点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
快捷通道:申请荣誉值无答案申请取消悬赏投诉有答案未采纳为最佳
结帖率:100% (26/26)
发表于 2021-8-7 16:38:31 | 显示全部楼层   重庆市重庆市
  
局_Word对象.获取 (“word.Application”)
' ActiveDocument.Sections(1).Range.Select
局_ActiveDocument = 局_Word对象.读对象型属性 (“ActiveDocument”, )
局_Sections = 局_ActiveDocument.读对象型属性 (“Sections”, )
局_Sections.读对象型属性 (“Item”, 1).读对象型属性 (“Range”, ).方法 (“Select”, )
' ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
局_Word对象.读对象型属性 (“ActiveWindow”, ).读对象型属性 (“ActivePane”, ).读对象型属性 (“View”, ).写属性 (“SeekView”, #wdSeekCurrentPageHeader )  ' #wdSeekCurrentPageHeader的值=9
局_Selection = 局_Word对象.读对象型属性 (“Selection”, )
' Selection.HeaderFooter.Shapes.AddTextEffect( _
' PowerPlusWaterMarkObject8163454, "保密1", "等线", 1, False, False, 0, 0). _Select
局_Selection.读对象型属性 (“HeaderFooter”, ).读对象型属性 (“Shapes”, ).对象型方法 (“AddTextEffect”, 0, “保密1”, “等线”, 1, 假, 假, 0, 0).方法 (“Select”, )
局_ShapeRange = 局_Selection.读对象型属性 (“ShapeRange”, )
' Selection.ShapeRange.Name = "PowerPlusWaterMarkObject8163454"
局_ShapeRange.写属性 (“Name”, “PowerPlusWaterMarkObject8163454”)
' Selection.ShapeRange.TextEffect.NormalizedHeight = False
局_ShapeRange.读对象型属性 (“TextEffect”, ).写属性 (“NormalizedHeight”, )
' Selection.ShapeRange.Line.Visible = False
局_ShapeRange.读对象型属性 (“Line”, ).写属性 (“Visible”, )
' Selection.ShapeRange.Fill.Visible = True
局_ShapeRange.读对象型属性 (“Fill”, ).写属性 (“Visible”, )
' Selection.ShapeRange.Fill.Solid
局_ShapeRange.读对象型属性 (“Fill”, ).方法 (“Solid”, )
' Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
局_ShapeRange.读对象型属性 (“Fill”, ).读对象型属性 (“ForeColor”, ).写属性 (“RGB”, 取颜色值 (192, 192, 192))
' Selection.ShapeRange.Fill.Transparency = 0.5
局_ShapeRange.读对象型属性 (“Fill”, ).写属性 (“Transparency”, 0.5)
' Selection.ShapeRange.Rotation = 315
局_ShapeRange.写属性 (“Rotation”, 315)
' Selection.ShapeRange.LockAspectRatio = True
局_ShapeRange.写属性 (“LockAspectRatio”, )
' Selection.ShapeRange.Height = CentimetersToPoints(5.9)
局_ShapeRange.写属性 (“Height”, 局_Word对象.数值方法 (“CentimetersToPoints”, 5.9))
' Selection.ShapeRange.Width = CentimetersToPoints(14.75)
局_ShapeRange.写属性 (“Height”, 局_Word对象.数值方法 (“Width”, 14.75))
' Selection.ShapeRange.WrapFormat.AllowOverlap = True
局_ShapeRange.读对象型属性 (“WrapFormat”, ).写属性 (“AllowOverlap”, )
' Selection.ShapeRange.WrapFormat.Side = wdWrapNone
局_ShapeRange.读对象型属性 (“WrapFormat”, ).写属性 (“Side”, #wdWrapNone )  ' #wdWrapNone的值=3
' Selection.ShapeRange.WrapFormat.Type = 3
局_ShapeRange.读对象型属性 (“WrapFormat”, ).写属性 (“Type”, 3)
' Selection.ShapeRange.RelativeHorizontalPosition = _
' wdRelativeVerticalPositionMargin
局_ShapeRange.写属性 (“RelativeHorizontalPosition”, #wdRelativeVerticalPositionMargin )  ' wdRelativeVerticalPositionMargin的值=0
' Selection.ShapeRange.RelativeVerticalPosition = _
' wdRelativeVerticalPositionMargin
局_ShapeRange.写属性 (“RelativeVerticalPosition”, #wdRelativeVerticalPositionMargin )  ' wdRelativeVerticalPositionMargin的值=0
' Selection.ShapeRange.Left = wdShapeCenter
局_ShapeRange.写属性 (“Left”, #wdShapeCenter )  ' wdShapeCenter的值=-999995
' Selection.ShapeRange.Top = wdShapeCenter
局_ShapeRange.写属性 (“Top”, #wdShapeCenter )  ' wdShapeCenter的值=-999995
' ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
局_Word对象.读对象型属性 (“ActiveWindow”, ).读对象型属性 (“ActivePane”, ).读对象型属性 (“View”, ).写属性 (“SeekView”, #wdSeekMainDocument )  ' #wdSeekMainDocument的值=0




补充内容 (2021-8-7 17:56):
补充见下面

评分

参与人数 1荣誉 +1 收起 理由
笨潴 + 1 热心帮助他人,荣誉+1,希望继续努力(*^__^*) 嘻嘻!

查看全部评分

回复

使用道具 举报

结帖率:100% (26/26)
发表于 2021-8-7 17:56:18 | 显示全部楼层   重庆市重庆市
局_ShapeRange.写属性 (“Height”, 局_Word对象.数值方法 (“Width”, 14.75))
更改为
局_ShapeRange.写属性 (“Width”, 局_Word对象.数值方法 (“CentimetersToPoints”, 14.75))
回复

使用道具 举报

结帖率:61% (35/57)

签到天数: 4 天

 楼主| 发表于 2021-8-7 22:05:24 | 显示全部楼层   广东省梅州市
梦寻简单 发表于 2021-8-7 17:56
局_ShapeRange.写属性 (“Height”, 局_Word对象.数值方法 (“Width”, 14.75))
更改为
局_ShapeRange.写属 ...

捕获.PNG 大神。不能显示。你发的最后也改了。不知页眉上面是什么
回复

使用道具 举报

结帖率:100% (26/26)
发表于 2021-8-7 22:38:22 | 显示全部楼层   重庆市重庆市
lovely203 发表于 2021-8-7 22:05
大神。不能显示。你发的最后也改了。不知页眉上面是什么

我这可以显示的啊
回复

使用道具 举报

结帖率:61% (35/57)

签到天数: 4 天

 楼主| 发表于 2021-8-7 23:16:14 高大上手机用户 | 显示全部楼层   广东省梅州市
梦寻简单 发表于 2021-8-7 22:38
我这可以显示的啊

麻烦整个源码发过试试
回复

使用道具 举报

结帖率:100% (26/26)
发表于 2021-8-7 23:53:50 | 显示全部楼层   重庆市重庆市
lovely203 发表于 2021-8-7 23:16
麻烦整个源码发过试试

除了变量没写,其他的都是完整的哦
回复

使用道具 举报

结帖率:61% (35/57)

签到天数: 4 天

 楼主| 发表于 2021-8-8 06:37:45 高大上手机用户 | 显示全部楼层   广东省梅州市
梦寻简单 发表于 2021-8-7 23:53
除了变量没写,其他的都是完整的哦

值应该不会有备注错吧!
回复

使用道具 举报

结帖率:100% (26/26)
发表于 2021-8-8 13:26:12 | 显示全部楼层   重庆市重庆市
lovely203 发表于 2021-8-8 06:37
值应该不会有备注错吧!

没有。你可以去MSDN看看文档
回复

使用道具 举报

结帖率:61% (35/57)

签到天数: 4 天

 楼主| 发表于 2021-8-8 15:12:59 | 显示全部楼层   广东省梅州市
梦寻简单 发表于 2021-8-8 13:26
没有。你可以去MSDN看看文档

捕获.PNG 都没问题。不知怎么会跑到页眉上面去了。按删除水印就点一样就被删除了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:wp@125.la
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表