• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 關于SVN的word比較腳本[Win7]

    上一篇 / 下一篇  2010-04-13 22:40:04 / 個人分類:SVNの関連

    Win7操作系統運行SVN

    SVN打開Word出現錯誤,缺少"diff-doc.js"。

    解決:在指定的目錄【C:\Program Files (x86)\TortoiseSVN\Diff-Scripts】下新建記事本 diff-doc.txt。并改為diff-doc.js。

    在網上查找腳本,拷貝到diff-doc.js中,即可。

    ---------------------------------------------------

    diff-doc.js文件!

    其內容如下:

     

    QUOTE:

    var objArgs,num,sBaseDoc,sNewDoc,objScript,word,destination;
    // Microsoft Office versions for Microsoft Windows OS
    var vOffice2000 = 9;
    var vOffice2002 = 10;
    var vOffice2003 = 11;
    var vOffice2007 = 12;

    // WdCompareTarget
    var wdCompareTargetSelected = 0;
    var wdCompareTargetCurrent = 1;
    var wdCompareTargetNew = 2;
    // WdViewType
    var wdMasterView = 5;
    var wdNormalView = 1;
    var wdOutlineView = 2;
    // WdSaveOptions
    var wdDoNotSaveChanges = 0;
    var wdPromptToSaveChanges = -2;
    var wdSaveChanges = -1;

    objArgs = WScript.Arguments;
    num = objArgs.length;
    if (num < 2)
    {
       WScript.Echo("Usage: [CScript. WScript] diff-doc.js base.doc new.doc");
       WScript.Quit(1);
    }

    sBaseDoc = objArgs(0);
    sNewDoc = objArgs(1);

    objScript. = new ActiveXObject("Scripting.FileSystemObject" );
    if ( ! objScript.FileExists(sBaseDoc))
    {
        WScript.Echo("File " + sBaseDoc + " does not exist.  Cannot compare the documents.");
        WScript.Quit(1);
    }
    if ( ! objScript.FileExists(sNewDoc))
    {
        WScript.Echo("File " + sNewDoc + " does not exist.  Cannot compare the documents.");
        WScript.Quit(1);
    }

    objScript. = null;

    try
    {
       word = WScript.CreateObject("Word.Application") ;
    }
    catch(e)
    {
       WScript.Echo("You must have Microsoft Word installed to perform. this operation.");
       WScript.Quit(1);
    }

    word.visible = true;

    // Open the new document
    destination = word.Documents.Open(sNewDoc) ;

    // If the Type property returns either wdOutlineView or wdMasterView and the Count property returns zero, the current document is an outline.
    if (((destination.ActiveWindow.View.Type == wdOutlineView) || (destination.ActiveWindow.View.Type == wdMasterView)) && (destination.Subdocuments.Count == 0))
    {
        // Change the Type property of the current document to normal
        destination.ActiveWindow.View.Type = wdNormalView;
    }

    // Compare to the base document
    if (Number(word.Version) <= vOffice2000)
    {
        // Compare for Office 2000 and earlier
        destination.Compare(sBaseDoc);
    }
    else
    {
        // Compare for Office XP (2002) and later
        destination.Compare(sBaseDoc, "Comparison", wdCompareTargetNew, true, true);
    }

       
    // Show the comparison result
    if (Number(word.Version) < vOffice2007)
    {
        word.ActiveDocument.Windows(1).Visible = 1;
    }
       
    // Mark the comparison document as saved to prevent the annoying
    // "Save as" dialog from appearing.
    word.ActiveDocument.Saved = 1;
       
    // Close the first document
    if (Number(word.Version) >= vOffice2002)
    {
        destination.Close(wdDoNotSaveChanges);
    }

     


    TAG: SVN Word WORD word 腳本

     

    評分:0

    我來說兩句

    顯示全部

    :loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

    日歷

    « 2011-06-14  
       1234
    567891011
    12131415161718
    19202122232425
    2627282930  

    數據統計

    • 訪問量: 998
    • 日志數: 7
    • 建立時間: 2010-04-13
    • 更新時間: 2010-05-09

    RSS訂閱

    Open Toolbar
    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>