Changeset 10629
- Timestamp:
- 2005-09-23T11:28:37+12:00 (18 years ago)
- Location:
- trunk/winbin/bin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/winbin/bin/word2html.frm
r10573 r10629 36 36 37 37 Private Sub Form_Load() 38 Dim wa As Word.Application 38 'For solving the backward compatability of MS Automation with VB script 39 'We need to use the late binding technique, in which mean that we need to 40 'define all Office Automation variable as an Object first and it can then 41 'to decide the office version at run-tim. 42 43 'Creat a Word Application 44 Dim objWA As Object 45 Set objWA = CreateObject("Word.Application") 46 objWA.Visible = True 47 39 48 Dim cmdln As String 40 49 Dim src As String … … 43 52 cmdln = LCase(Command()) 44 53 'MsgBox ("Command:" + cmdln) 45 'cmdln = Chr(34) & "H:\chi\gsdl\collect\WordTest\import\word0 1.doc" & Chr(34) & Chr(34) & "H:\chi\gsdl\collect\WordTest\tmp\word01.html" & Chr(34)54 'cmdln = Chr(34) & "H:\chi\gsdl\collect\WordTest\import\word03_01.doc" & Chr(34) & Chr(34) & "H:\chi\gsdl\collect\WordTest\tmp\word03_01.html" & Chr(34) 46 55 src = Trim(Left(cmdln, (InStr(cmdln, ".doc") + 4))) 47 56 src = Mid(src, 2, Len(src) - 2) 57 'MsgBox ("Src:" + src) 48 58 If InStr(src, ":") <> 2 Then src = CurDir + "\" + src 49 50 59 dst = Trim(Right(cmdln, Len(cmdln) - (InStr(cmdln, ".doc") + 4))) 51 60 dst = Mid(dst, 2, Len(dst) - 2) 52 61 If InStr(dst, ":") <> 2 Then dst = CurDir + "\" + dst 53 62 54 'Creat a Word Application55 Set wa = CreateObject("Word.application")56 wa.Visible = True57 63 58 ' Open a Word Document59 Dim wd As Word.Documents60 Set wd = wa.Documents64 'Create a Word Document Object and Open a Word Document 65 Dim objWD As Object 66 Set objWD = objWA.Documents 61 67 62 wd.Open (src) 63 'wd(1).SaveAs dst, HTMLFileFormat(); 64 wd(1).SaveAs dst, wdFormatHTML 65 66 wd(1).Close 68 objWD.Open (src) 69 objWD(1).SaveAs dst, wdFormatHTML 70 objWD(1).Close 67 71 68 72 ' Quite Word Application 69 wa.Quit73 objWA.Quit 70 74 71 75 'Release Objects 72 Set wa= Nothing73 Set wd= Nothing76 Set objWA = Nothing 77 Set objWD = Nothing 74 78 75 79 End -
trunk/winbin/bin/word2html.vbp
r10573 r10629 1 1 Type=Exe 2 Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\system32\ STDOLE2.TLB#OLE Automation2 Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\system32\stdole2.tlb#OLE Automation 3 3 Reference=*\G{91493440-5A91-11CF-8700-00AA0060263B}#2.7#0#C:\Program Files\Microsoft Office\OFFICE11\MSPPT.OLB#Microsoft PowerPoint 10.0 Object Library 4 4 Reference=*\G{00020905-0000-0000-C000-000000000046}#8.2#0#C:\Program Files\Microsoft Office\OFFICE11\MSWORD.OLB#Microsoft Word 10.0 Object Library -
trunk/winbin/bin/word2html.vbw
r10574 r10629 1 Form1 = -411, 30, 601, 642, C, 44, 58, 1056, 670, C1 Form1 = -411, 30, 601, 642, Z, 44, 58, 1056, 670, C
Note:
See TracChangeset
for help on using the changeset viewer.