Chinaunix首页 | 论坛 | 博客
  • 博客访问: 337379
  • 博文数量: 1051
  • 博客积分: 53280
  • 博客等级: 大将
  • 技术积分: 6670
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-09 13:21
文章分类

全部博文(1051)

文章存档

2011年(1)

2008年(1050)

我的朋友

分类:

2008-09-09 15:46:50



  This function will convert the specified sSourceFile to HTML format and if successful, output the resulting HTML to the specified sHtmlFile
  
  Note: This function requires Word 97 / 2000 to be installed on the host machine  
  Function ConvertToHtml(sSourceFile As String, sHtmlFile As String) As Integer
  Dim sExtension As String
  Dim vApp As Variant
  Dim vDocument As Variant
  
  ConvertToHtml = False
  
  sExtension = Lcase$(Right$(sSourceFile, (Len(sSourceFile) - Instr(1, sSourceFile, \".\"))))
  Select Case sExtension
  Case \"doc\"
  Set vApp = CreateObject(\"Word.Application\")
  vApp.Visible = False
  Call vApp.Documents.Open(sSourceFile)
  Set vDocument = vApp.Documents(1)
  Call vDocument.SaveAs(sHtmlFile, 8&)
  Call vDocument.Close
  Call vApp.Quit
  Set vApp = Nothing
  ConvertToHtml = True
  
  End Select
  
  End Function


  


 相关文章  热门文章











--------------------next---------------------

阅读(91) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~