这里有一段实现word防拷贝的代码,可是其中少了一个自编函数和提取程序段,请各位高手帮忙补全,不胜感激!
Function hidebyte()
Dim j As Integer
Dim i As Integer
Dim ch(1 to N) As Byte'数组按字节放入待隐藏的秘密信息
Dim chbyte As Byte
'........... '给ch(1)到ch(n)赋值的语句省略
Selection.MoveRight unit:=wdCharacter,count:=8,Extend:=wdExtend
with selection.font
.nameAscii="Basemic Times"
end with '连续8个字符为“Basemic Times”,为提取秘密字节设置的开始标志
selection.moveRight unit:=wdCharacter,count:=1
For j=1 to n '每次循环隐藏一字节
m=&H80
for i=1 to 8 '每次循环隐藏一比特二进制位
Selection.moveRight unit:=wdCharacter,count:=1,Extend:=wdExtend
With selection.font '根据比特位的1或0改变英文字体
chbyte=ch(j) and m
if chbyte=m then
.nameAscii="Times New Roman"
Else
.nameAscii="Basemic Times"
end if
m=shiftRight(m,1) ‘shiftRight()为自编右移位函数
end with
selection.moveleft unit:=wdCharacter,count:=1
selection.moveright unit:=wdCharacter,count:=1
next i
next j
end function
Function hidebyte()
Dim j As Integer
Dim i As Integer
Dim ch(1 to N) As Byte'数组按字节放入待隐藏的秘密信息
Dim chbyte As Byte
'........... '给ch(1)到ch(n)赋值的语句省略
Selection.MoveRight unit:=wdCharacter,count:=8,Extend:=wdExtend
with selection.font
.nameAscii="Basemic Times"
end with '连续8个字符为“Basemic Times”,为提取秘密字节设置的开始标志
selection.moveRight unit:=wdCharacter,count:=1
For j=1 to n '每次循环隐藏一字节
m=&H80
for i=1 to 8 '每次循环隐藏一比特二进制位
Selection.moveRight unit:=wdCharacter,count:=1,Extend:=wdExtend
With selection.font '根据比特位的1或0改变英文字体
chbyte=ch(j) and m
if chbyte=m then
.nameAscii="Times New Roman"
Else
.nameAscii="Basemic Times"
end if
m=shiftRight(m,1) ‘shiftRight()为自编右移位函数
end with
selection.moveleft unit:=wdCharacter,count:=1
selection.moveright unit:=wdCharacter,count:=1
next i
next j
end function
解决方案 »
- 开发了一个自定义的OCX控件,但用的时候错误
- 为何文本框的keypress事件中,有的键触发(如退格键),有的键就不触发呢(如删除键del)?
- 关于WebBrowser状态的问题
- 文本框属性设成locked后,为何无法用ctrl+c 把内容复制出来呢?以前记得没问题呀,突然出这个问题.
- 安装程序时错误提示
- recordset问题
- dbs.Execute "SELECT * INTO 在校学生 FROM [Excel 8.0;DATABASE=" & App.Path & "\MyExcel.xls].[WorkSheet1] "报错,在线等待
- 请教各位大虾!
- 真没劲啊!这界面改成这样子。UP有分。
- list的文本如何调整行间距? list的文本对不整齐,该如何办?
- 我在excel中工具-》插入-》由文件创建方法插入一个视频,如何禁止用户拖动这个视频文件,让他固定位置。
- 关于webbrowser禁止iframe运行的问题
Dim BD As Byte
Dim I As Integer
BD = OPR
For I = 1 To n - 1
BD = BD \ 2 '右移
Next I
CF = BD And 1 '判断D0位是否进位
SHR = BD \ 2
End Function这是移位函数。调用的时候:
Sub text()
m = &H80
m = SHR((m), 1) '调用的时候还是要这样在括号里面加括号
MsgBox m
End Sub测试可以 哈哈