• 合并文档时让第一页为奇数


    目的:实现打印时自动将第一页排在奇数页,以防出现两份资料不独立的情况。</pre><pre name="code" class="vb">因为是双面打印,故必须让文档的第一页位于奇数页,可以获取页码,插入空白页,可以插入奇数页分页符

    Sub 合并文档时让第一页为奇数()      
    'ThisDocument.BuiltInDocumentProperties(wdPropertyPages)  
    Rem Selection.Information(wdNumberOfPagesInDocument)  
    Rem ActiveDocument.ComputeStatistics(wdStatisticPages)  
    Rem ActiveDocument.ActiveWindow.ActivePane.Pages.Count  
        With Application.FileDialog(msoFileDialogFilePicker)  
            If .Show <> -1 Then Exit Sub  
            For Each f In .SelectedItems  
                Selection.InsertFile f  
                Selection.InsertBreak Type:=wdSectionBreakOddPage  '插入奇数页分节符 wdSectionBreakEvenPage  '插入偶数页分节符  
      
                'If ActiveDocument.content.Information(wdNumberOfPagesInDocument) Mod 2 <> 0 Then  
                '    ActiveDocument.content.InsertBreak Type:=wdPageBreak  
                'End If  
            Next  
        End With  
      
    End Sub  
  • 相关阅读:
    ssrf简介
    Mysql 命令 load data infile
    基于约束的SQL注入笔记
    ms17-010
    thinkphp5.0&5.1命令执行 和 thinkphp3.2.3sql注入
    抓取分析菜刀流量
    lamp环境的搭建
    php伪协议
    LeetCode-336 Palindrome Pairs
    LeetCode-335 Self Crossing
  • 原文地址:https://www.cnblogs.com/zhanglei1371/p/6664896.html
Copyright © 2020-2023  润新知