zoukankan      html  css  js  c++  java
  • DisplayPageBoundaries 打开word后自动将页面间空白隐藏 (auto+定时器)

    每次打开文档都要鼠标点击页面间空白处,将其隐藏

    尝试过在

    AutoOpen,
    AutoExec
    等宏中添加
    ActiveWindow.View.DisplayPageBoundaries = False
    但没有效果

    今天发现可以在vba中设置定时器,尝试

    AutoOpen
    中添加一个定时器,由定时器回调函数实现
    ActiveWindow.View.DisplayPageBoundaries = False
    Sub HiddenPageBoundaries()
        On Error Resume Next
        ActiveWindow.View.DisplayPageBoundaries = False
        MsgBox ("Hiden Page Bounaries!")
    End Sub
    
    Sub AutoOpen()
        On Error Resume Next
        'Application.DisplayAlerts = wdAlertsNone
        ActiveWindow.View.ShowSpaces = False
        Application.OnTime When:=Now + TimeValue("00:00:02"), Name:="HiddenPageBoundaries", Tolerance:=0
    End Sub

    参考

    OnTime 

     

  • 相关阅读:
    Redis的常用命令及数据类型
    Redis介绍与安装
    Docker
    Linux Shell——正则表达式
    Linux Shell 基础
    python常见报错
    CMDB
    python学习
    Python 3.x标准模块库目录
    Python笔记——Django路由系统
  • 原文地址:https://www.cnblogs.com/itzxy/p/7626986.html
Copyright © 2011-2022 走看看