【asp生成word文件怎么打开】asp生成word文件

更新时间:2014-12-31    来源:word    手机版     字体:

【www.bbyears.com--word】







生成<a href="http://www.bbyears.com/clist-116-1.html" target="_blank" class="keylink">word</a>文档

<script language="vbscript">
sub builddoc()
    On Error Resume Next

    Dim wApp
    
    Set wApp = CreateObject("Word.Application")
    If Err.number > 0 Then
        Alert "没法保存为Word文件,请正确安装Word97"
    else
    wApp.visible = True 
    wApp.Documents.add
    
                     wApp.Selection.TypeParagraph
                     wApp.Selection.Font.Bold = True
                     wApp.Selection.TypeText "programfan"
                     
                     wApp.Selection.ParagraphFormat.Alignment = 1 
                      rem 居 中
                                          
                     wApp.Selection.TypeParagraph   
                     wApp.Selection.Font.Bold = false                  
                     
                     wApp.Selection.TypeText "-- programfan.com"
                        
                     wApp.Selection.TypeParagraph   
                     
                     wApp.Selection.ParagraphFormat.LeftIndent = wApp.CentimetersToPoints(0)
                     wApp.Selection.ParagraphFormat.FirstLineIndent = wApp.CentimetersToPoints(0.72/2*2)
                      
                     wApp.Selection.TypeParagraph
                     wApp.Selection.Font.Bold = false
                     wApp.Selection.ParagraphFormat.Alignment = 0
                     
                       
                       
                         wapp.selection.typetext document.form1.doc1.value
                        wApp.Selection.TypeParagraph   
                     

                      rem 居 右
                     wApp.Selection.TypeParagraph   
                     wApp.Selection.Font.Bold = false                  
                     wApp.Selection.TypeText Now()
                     wApp.Selection.TypeParagraph   
                     wApp.Saved = true 
                    wapp.ActiveDocument.SaveAs "c:\a.doc"
                    wapp.close
                     
  end if

end sub
</script>



 



 


生成word文档






本文来源:http://www.bbyears.com/bangongshuma/11855.html

猜你感兴趣

热门标签

更多>>

本类排行