本文作者:office教程网

word怎么用VBA命令完成保存退出

office教程网 2024-05-14 09:39:53
后台-系统设置-扩展变量-手机广告位-内容正文顶部
摘要: 1、打开Word文件的 VBA编辑器,快捷键 Alt F11,右击【ThisDocument】-》 【插入模块】; 2、双击刚才插入的【模块1】,添加如下代码: Private Function SaveAsFile(ByVal fileFormat As S...

1、打开Word文件的 VBA编辑器,快捷键 Alt F11,右击【ThisDocument】-》 【插入模块】;
2、双击刚才插入的【模块1】,添加如下代码:
Private Function SaveAsFile(ByVal fileFormat As String)

word文档里的工具栏窗口怎么打开

word文档里的工具栏窗口怎么打开 打开word文档 在word中的菜单栏处单击鼠标右键 选中或取消功能区最小化就是隐藏和显示工具栏的选项了,前面的小勾就是选中和取消的区分.

Dim strDocName As String
    Dim intPos As Integer
    'Find position of extension in filename
    strDocName = ActiveDocument.Name
    intPos = InStrRev(strDocName, ".")
    If intPos = 0 Then
        'If the document has not yet been saved
        'Ask the user to provide a filename
        strDocName = InputBox("Please enter the name of your document.")
    Else
        'Strip off extension
        strDocName = Left(strDocName, intPos - 1)
        strDocName = strDocName & fileFormat
    End If
    'Save file with new extension
    ActiveDocument.SaveAs fileName:=strDocName, fileFormat:=wdFormatText
    'Close active document
    ActiveDocument.Close SaveChanges:=wdSaveChanges, OriginalFormat:=wdOriginalDocumentFormat
     
End Function
3、保存代码及文件,且关闭word并重新打开,重新打开点击【选项】-》 【启用此内容】

WORD文档打印如何取消

WORD文档打印如何取消 取消word文档中打印的任务的操作方法: 1.双击任务栏上的打印机图标: 2.弹出打印机对话框,在需要取消打印的文档上单击鼠标右键,在弹出的快捷菜单选择取消即可,如图所示.

后台-系统设置-扩展变量-手机广告位-内容正文底部
未经允许不得转载:

作者:office教程网,原文地址:word怎么用VBA命令完成保存退出发布于2024-05-14 09:39:53
转载或复制请以超链接形式并注明出处 演示站

分享到:

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

留言与评论(共有 0 条评论)
   
验证码: