本站首页    管理页面    写新日志    退出


«September 2025»
123456
78910111213
14151617181920
21222324252627
282930


公告
================

注会练习软件
http://www.cpasoft.com.cn
我的注会软件官网

http://blog.163.com/abc7105@126/

 

 


哈哈,热爱快“过气”的DELPHI


我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:注册会计师(注会)练习软件
日志总数:398
评论数量:116
留言数量:27
访问次数:3273312
建立时间:2005年6月6日




word宏对文件进行批量操作
软件技术

吕向阳 发表于 2009/3/7 0:37:09

Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As LongPrivate Type OPENFILENAME       lStructSize As Long       hwndOwner As Long       hInstance As Long       lpstrFilter As String       lpstrCustomFilter As String       nMaxCustFilter As Long       nFilterIndex As Long       lpstrFile As String       nMaxFile As Long       lpstrFileTitle As String       nMaxFileTitle As Long       lpstrInitialDir As String       lpstrTitle As String       flags As Long       nFileOffset As Integer       nFileExtension As Integer       lpstrDefExt As String       lCustData As Long       lpfnHook As Long       lpTemplateName As StringEnd TypeSub convfile(filename As String)Dim name As String '文件名name = filenameChangeFileOpenDirectory "F:\_delphi60prog\fromnet\"      Documents.Open filename:=name, ConfirmConversions:=False, ReadOnly _        :=False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate _        :="", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="" _        , Format:=wdOpenFormatAuto, XMLTransform:=""    Selection.Find.ClearFormatting    With Selection.Find        .Text = "<DIV 7style="        .Replacement.Text = ""        .Forward = True        .Wrap = wdFindContinue        .Format = False        .MatchCase = False        .MatchWholeWord = False        .MatchByte = True        .MatchWildcards = False        .MatchSoundsLike = False        .MatchAllWordForms = False    End With    Selection.Find.Execute    Selection.TypeBackspace    Selection.HomeKey Unit:=wdStory, Extend:=wdExtend    Selection.Delete Unit:=wdCharacter, Count:=1    ActiveDocument.SaveAs filename:=name, FileFormat:=wdFormatHTML, _        LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _        :="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _        SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _        False             Documents.Close savechanges                          End Sub   Private Sub CommandButton1_Click()Dim filename As StringDim result As IntegerDim allcount As IntegerWith Application.FileDialog(msoFileDialogFilePicker).Title = "选择雇员照片".Filters.Add "JPEGs", "*.htm".FilterIndex = 1.AllowMultiSelect = True result = .Showallcount = .SelectedItems.Count If (result <> 0) ThenFor i = 1 To allcount  filename = Trim(.SelectedItems.Item(i))  convfile (filename)Next i '  ActiveWindow.CloseEnd If   End WithEnd Sub Private Sub UserForm_Click() End Sub


阅读全文(962) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.078 second(s), page refreshed 144805577 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号