当前位置:首页经验技巧Office经验office基础

word文档如何分类存放,存放,文档,分类

2026-01-30 09:56:22

1.我有几千word文档

你自己编辑个程序,读出文档的第一行内容,然后关闭这个文档,用程序把它复制到指定的地方。

下面是用VB读WORD文件的方法:'VB读取WORD文件的例子'向窗体添加Command,Text,CommonDialog控件'单击工程\引用,添加Microsoft Word 11.0 Object Library (即是Word.Application)' Private Sub Command1_Click() Dim lsFileName As String Dim lsPath As String Dim lsName As String Dim lbApp As Boolean Dim llCount As Long Dim wordObj As Word.Application'浏览要添加的的文件 CommonDialog1.CancelError = True '取消报错 并且跳出执行!On Error GoTo err_cancel CommonDialog1.DialogTitle = "选择要打开的Word文件"'CommonDialog1.InitDir = App.Path CommonDialog1.Filter = "Word文件(*.doc)|*.doc" CommonDialog1.FileName = "" CommonDialog1.ShowOpen lsFileName = CommonDialog1.FileName '获取完整路径 lsName = CommonDialog1.FileTitle '只获取文件名 lsPath = Replace$(lsFileName, lsName, "") '获取文件所在的路径'循环进行处理!判断是否存在打开的word进程 !lbApp = False Do While True On Error Resume Next Set wordObj = GetObject(, "Word.Application") '用于判断已经打开的word进程 If wordObj Is Nothing Then Exit Do '如果没有找到进程那么就退出循环 If wordObj.Documents.Count = 0 Then '如果是一个空进程就释放 wordObj.Quit Set wordObj = Nothing Else For llCount = 1 To wordObj.Documents.Count '这个应用就是,手工打开文件的应用!If Err.Number = 0 Then '有Word已经打开 If wordObj.Documents(llCount).FullName = lsFileName Then '判断是否有要打开的进程 Text1.Text = wordObj.Documents(llCount).Content.Text '这个是对文件的操作 GoTo endSub End If End If lbApp = True Next End If If llCount <> 0 Then Exit Do '所有打开的里面没有要打开的文件 Loop Err.Clear If lbApp = False Then Set wordObj = CreateObject("Word.Application") '创建word应用类 wordObj.Visible = False wordObj.Documents.Open (lsFileName) Text1.Text = wordObj.ActiveDocument.Content.Text wordObj.Quit Set wordObj = Nothing Else wordObj.Documents.Open (lsFileName) '直接在原来的应用上打开文件 Text1.Text = wordObj.ActiveDocument.Content.Text wordObj.ActiveDocument.Close (True) ' (False) '关闭打开的文件'但是不关闭应用 End If endSub:'Label.Caption = Mid(Text1.Text, 1, 5) '取文件的最前面的5个字符'FileCopy lsFileName, "F:\234\" & lsName '"F:\234\"为要保存文件的位置,文件必须存在 MsgBox "成功" Exit Sub err_cancel:MsgBox "你点的是取消" End Sub'下面是搜索某文件下所有文件的过程'要向窗体添加List1控件 Sub sosuofile(MyPath As String) Dim Myname As String Dim dir_i() As String Dim i, idir As Long If Right(MyPath, 1) <> "\" Then MyPath = MyPath + "\" Myname = Dir(MyPath, vbDirectory Or vbHidden Or vbNormal Or vbReadOnly) Do While Myname <> "" If Myname <> "." And Myname <> ".." Then If (GetAttr(MyPath & Myname) And vbDirectory) = vbDirectory Then '如果找到的是目录'这三句若不注释,则还要搜所有目录' idir = idir + 1' ReDim Preserve dir_i(idir) As String' dir_i(idir - 1) = Myname'这三句若不注释,则还要搜所有目录 Else: List1.AddItem "" & MyPath & Myname '把找到的文件显示到列表框中 End If End If Myname = Dir '搜索下一项 Loop For i = 0 To idir - 1 Call sosuofile(MyPath + dir_i(i)) Next i ReDim dir_i(0) As String End Sub 结合上面两部分,你自己再研究一下吧。

2.公司文档很乱 要整理好 怎么整理才有效讲文档保存好 归类好

文档的归类整理是一个十分复杂的系统工程,本人是这样做的: 一、大类归类,例如,按文档的Excel或Word分类,存放在两个大的文件夹内; 二、按科目分类,如:文章、合同、帐务、其它等; 三、按日期分类,保存每个文档时,用括号注明存入日期,如Word文档《合同(080607)》,表示2008年6月7日存入或签订的合同; 这样,将来要查找这个文档时,就可在文件夹Word/合同,并根据已掌握的日期,很方便地找到,其它文档的归类方法类推。


免责声明:本站信息来自网络收集及网友投稿,仅供参考,如果有错误请反馈给我们更正,对文中内容的真实性和完整性本站不提供任何保证,不承但任何责任,谢谢您的合作。
版权所有:五学知识网 Copyright © 2015-2026 www.z8000w.com. All Rights Reserved .