VBA关闭Word样式自动更新
时间:2008-09-10
来源:互联网
Sub niuniu()
Dim updates As styles
Set updates = ActiveDocument.styles
If updates.InUse = True Then
updates.AutomaticallyUpdate = False
End If
End Sub
作者: robin521 发布时间: 2008-09-10
Sub niuniu()
Dim updates As styles
Set updates = ActiveDocument.styles
If updates.InUse = True Then
updates.AutomaticallyUpdate = False
End If
End Sub
欢迎robin521!
Sub niuniu()
Dim styleLoop As Style
For Each styleLoop In ActiveDocument.Styles
If styleLoop.Type = wdStyleTypeParagraph Then
If styleLoop.InUse = True Then styleLoop.AutomaticallyUpdate = False
End If
Next styleLoop
End Sub
谢谢sylun兄的提醒,否则,我以为楼主是个分享贴,希以后注意。
InUse属性和AutomaticallyUpdate 属性均用于Style对象而非styles对象,另外,AutomaticallyUpdate属性在作用于字符样式时,可能出错。
[此贴子已经被作者于2008-9-10 17:56:02编辑过]
作者: 守柔 发布时间: 2008-09-10
楼主的好像是求助帖,老大可能没有细看。
试做了一下,不知是否规范,请老大赐教:
Sub test()
Dim oStyle As Style
For Each oStyle In ActiveDocument.Styles
With oStyle
If .InUse = True And .Type = wdStyleTypeParagraph Then
If .AutomaticallyUpdate = True Then .AutomaticallyUpdate = False
End If
End With
Next
End Sub
作者: sylun 发布时间: 2008-09-10
楼主的好像是求助帖,老大可能没有细看。
试做了一下,不知是否规范,请老大赐教:
Sub test()
Dim oStyle As Style
For Each oStyle In ActiveDocument.Styles
With oStyle
If .InUse = True And .Type = wdStyleTypeParagraph Then
If .AutomaticallyUpdate = True Then .AutomaticallyUpdate = False
End If
End With
Next
End Sub
谢谢sylun兄。
代码基本上大同小异,区别不大。
作者: 守柔 发布时间: 2008-09-10
作者: robin521 发布时间: 2008-09-11
作者: almes 发布时间: 2011-02-15
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28