コード例 #1
0
        void RoundTripCheck_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault)
        {
            if (!HookDocumentClose(Application.ActiveDocument))
            {
                return;
            }

            Application.System.Cursor = Word.WdCursorType.wdCursorWait;
            try
            {
                WordDocument doc = new WordDocument(Application.ActiveDocument, OfficeTextDocument.ProcessingType.eWordByWord);

                if (m_aRoundTripCheckWordProcessor == null)
                {
                    m_aRoundTripCheckWordProcessor = new RoundTripCheckWordProcessor(null);
                }

                if (doc.ProcessWordByWord(m_aRoundTripCheckWordProcessor))
                {
                    m_aRoundTripCheckWordProcessor = null;
                }
            }
            catch (Exception ex)
            {
                DisplayException(ex);
            }

            Application.System.Cursor = Word.WdCursorType.wdCursorNormal;
        }
コード例 #2
0
 public void DocumentClosed()
 {
     if (m_formFindReplace != null)
     {
         m_formFindReplace.Close();
     }
     m_formFindReplace = null;
     m_aRoundTripCheckWordProcessor = null;
 }
コード例 #3
0
        public void DocumentClosed()
        {
            if (m_formFindReplace != null)
            {
                m_formFindReplace.Close();
            }
            m_formFindReplace = null;

            m_aWordByWordProcessor     = null;
            m_aWordByWordFontProcessor = null;

            m_aWordByWordSpellFixerProcessor     = null;
            m_aWordByWordFontSpellFixerProcessor = null;

            m_aRoundTripCheckWordProcessor     = null;
            m_aRoundTripCheckFontWordProcessor = null;
        }
コード例 #4
0
        void RoundTripCheckFont_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault)
        {
            if (!HookDocumentClose(Application.ActiveDocument))
            {
                return;
            }

            Application.System.Cursor = Word.WdCursorType.wdCursorWait;
            try
            {
                WordDocument doc = new WordDocument(Application.ActiveDocument, OfficeTextDocument.ProcessingType.eWordByWord);

                if (m_aRoundTripCheckFontWordProcessor == null)
                {
                    // first get the fonts the user wants to process
                    FontConvertersPicker aFCsPicker = new FontConvertersPicker(doc);
                    if (aFCsPicker.ShowDialog() == DialogResult.OK)
                    {
                        FontConverters aFCs = aFCsPicker.SelectedFontConverters;
                        m_aRoundTripCheckFontWordProcessor = new RoundTripCheckWordProcessor(aFCs);
                    }
                }

                if (m_aRoundTripCheckFontWordProcessor != null)
                {
                    if (doc.ProcessWordByWord(m_aRoundTripCheckFontWordProcessor))
                    {
                        m_aRoundTripCheckFontWordProcessor = null;
                    }
                }
            }
            catch (Exception ex)
            {
                DisplayException(ex);
            }

            Application.System.Cursor = Word.WdCursorType.wdCursorNormal;
        }
コード例 #5
0
 void RoundTripReset_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault)
 {
     m_aRoundTripCheckWordProcessor     = null;
     m_aRoundTripCheckFontWordProcessor = null;
 }