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 

     

  • 相关阅读:
    Widget Factory
    233 Matrix
    青蛙的约会
    Longge's problem
    密码解锁
    SQFREE
    GCD
    [WC2011]最大XOR和路径
    [HNOI2011]XOR和路径
    [ZJOI2010]排列计数
  • 原文地址:https://www.cnblogs.com/itzxy/p/7626986.html
Copyright © 2011-2022 走看看