OSDN Git Service

[ 1252903 ] Plugin to display MS Word files
authorChristian List <list1974@hotmail.com>
Thu, 22 Sep 2005 00:59:59 +0000 (00:59 +0000)
committerChristian List <list1974@hotmail.com>
Thu, 22 Sep 2005 00:59:59 +0000 (00:59 +0000)
Plugins/dlls/CompareMSWordFiles.dll [new file with mode: 0644]
Plugins/list_of_sources.txt
Plugins/readme.txt
Plugins/src_VB/CompareMSWordFiles/CompareMSWordFiles.vbp [new file with mode: 0644]
Plugins/src_VB/CompareMSWordFiles/WinMergeScript.cls [new file with mode: 0644]

diff --git a/Plugins/dlls/CompareMSWordFiles.dll b/Plugins/dlls/CompareMSWordFiles.dll
new file mode 100644 (file)
index 0000000..341b130
Binary files /dev/null and b/Plugins/dlls/CompareMSWordFiles.dll differ
index a442c4e..286a64f 100644 (file)
@@ -86,6 +86,18 @@ last lines.
 
 
 --------------------------------------------------------------------------------
+DisplayMSWordFiles
+--------------------------------------------------------------------------------
+Displays the text content of a MS Word file, stripping away all formatting and embedded objects.
+No packing (no save).
+
+    Language: VB
+       Event: FILE_PACK_UNPACK
+ File filter: *.doc
+--------------------------------------------------------------------------------
+
+
+--------------------------------------------------------------------------------
 HideLastLetter
 --------------------------------------------------------------------------------
 The last non-space character is invisible in the merge editor (and restored
index a8b8420..c9b62f1 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-21 Christian
+ PATCH: [ 1252903 ] Plugin to display MS Word files
+  Plugins/list_of_sources.txt
+  New directory: Plugins\src_VB\CompareMSWordFiles
+  New file: Plugins\dlls\CompareMSWordFiles.dll
+
 2005-09-01 Kimmo
  PATCH: [ 1277316 ] New layout for list_of_sources.txt
   Submitted by Tim
diff --git a/Plugins/src_VB/CompareMSWordFiles/CompareMSWordFiles.vbp b/Plugins/src_VB/CompareMSWordFiles/CompareMSWordFiles.vbp
new file mode 100644 (file)
index 0000000..0aac43e
--- /dev/null
@@ -0,0 +1,37 @@
+Type=OleDll
+Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\WINNT\system32\stdole2.tlb#OLE Automation
+Class=WinMergeScript; WinMergeScript.cls
+Startup="(None)"
+HelpFile=""
+Title="CompareMSWordFiles"
+ExeName32="CompareMSWordFiles.dll"
+Command32=""
+Name="CompareMSWordFiles"
+HelpContextID="0"
+CompatibleMode="1"
+CompatibleEXE32="CompareMSWordFiles.dll"
+MajorVer=1
+MinorVer=0
+RevisionVer=0
+AutoIncrementVer=0
+ServerSupportFiles=0
+CompilationType=0
+OptimizationType=0
+FavorPentiumPro(tm)=0
+CodeViewDebugInfo=0
+NoAliasing=0
+BoundsCheck=0
+OverflowCheck=0
+FlPointCheck=0
+FDIVCheck=0
+UnroundedFP=0
+StartMode=1
+Unattended=0
+Retained=0
+ThreadPerObject=0
+MaxNumberOfThreads=1
+DebugStartupOption=0
+
+[MS Transaction Server]
+AutoRefresh=1
+
diff --git a/Plugins/src_VB/CompareMSWordFiles/WinMergeScript.cls b/Plugins/src_VB/CompareMSWordFiles/WinMergeScript.cls
new file mode 100644 (file)
index 0000000..d3f0bc9
--- /dev/null
@@ -0,0 +1,89 @@
+VERSION 1.0 CLASS
+BEGIN
+  MultiUse = -1  'True
+  Persistable = 0  'NotPersistable
+  DataBindingBehavior = 0  'vbNone
+  DataSourceBehavior  = 0  'vbNone
+  MTSTransactionMode  = 0  'NotAnMTSObject
+END
+Attribute VB_Name = "WinMergeScript"
+Attribute VB_GlobalNameSpace = False
+Attribute VB_Creatable = True
+Attribute VB_PredeclaredId = False
+Attribute VB_Exposed = True
+'/////////////////////////////////////////////////////////////////////////////
+'    This is a plugin for WinMerge.
+'    It will display the text content of MS Word files.
+'    Copyright (C) 2005  Christian List
+'
+'    This program is free software; you can redistribute it and/or modify
+'    it under the terms of the GNU General Public License as published by
+'    the Free Software Foundation; either version 2 of the License, or
+'    (at your option) any later version.
+'
+'    This program is distributed in the hope that it will be useful,
+'    but WITHOUT ANY WARRANTY; without even the implied warranty of
+'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+'    GNU General Public License for more details.
+'
+'    You should have received a copy of the GNU General Public License
+'    along with this program; if not, write to the Free Software
+'    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+'
+'/////////////////////////////////////////////////////////////////////////////
+'
+' RCS ID line follows -- this is updated by CVS
+' $Id$
+
+Option Explicit
+
+Public Property Get PluginEvent() As String
+    PluginEvent = "FILE_PACK_UNPACK"
+End Property
+
+Public Property Get PluginDescription() As String
+    PluginDescription = "Display the text content of MS Word files."
+End Property
+
+Public Property Get PluginFileFilters() As String
+    PluginFileFilters = "\.doc$"
+End Property
+
+Public Property Get PluginIsAutomatic() As Boolean
+    PluginIsAutomatic = True
+End Property
+
+Public Function UnpackFile(fileSrc As String, fileDst As String, ByRef bChanged As Boolean, ByRef subcode As Long) As Boolean
+    On Error GoTo CleanUp
+    
+    ' Start MS Word
+    Dim objWD As Object
+    Set objWD = CreateObject("Word.Application")
+    
+    ' Load the document into MS Word
+    Dim objDoc As Object
+    Set objDoc = objWD.Documents.Open(fileSrc)
+
+    ' Save the text content of the document
+    Open fileDst For Output Shared As #1
+    Print #1, objDoc.Content.Text
+    Close #1
+    
+    bChanged = True
+    UnpackFile = True
+    subcode = 1
+    
+CleanUp:
+    If Not objWD Is Nothing Then
+        ' Stop MS Word
+        objWD.Quit
+    End If
+End Function
+Public Function PackFile(fileSrc As String, fileDst As String, ByRef bChanged As Boolean, subcode As Long) As Boolean
+    ' We can't repack MS Word files
+    bChanged = False
+    PackFile = False
+    subcode = 1
+End Function
+