public FindReplaceForm(WordFindReplaceDocument doc)
        {
            InitializeComponent();
            m_doc = doc;

            // progressBar.Maximum = m_doc.DocumentEnd;

            // make sure these exist so don't throw an error later when we try to add to them
            if (Properties.Settings.Default.RecentFindWhat == null)
            {
                Properties.Settings.Default.RecentFindWhat = new System.Collections.Specialized.StringCollection();
            }
            else
            {
                foreach (string str in Properties.Settings.Default.RecentFindWhat)
                {
                    comboBoxFindWhat.Items.Add(str);
                }
            }

            if (Properties.Settings.Default.RecentReplaceWith == null)
            {
                Properties.Settings.Default.RecentReplaceWith = new System.Collections.Specialized.StringCollection();
            }
            else
            {
                foreach (string str in Properties.Settings.Default.RecentReplaceWith)
                {
                    comboBoxReplaceWith.Items.Add(str);
                }
            }

#if BUILD_FOR_OFF15
            helpProvider.SetHelpString(this, SILConvertersOffice13.Properties.Resources.FindReplaceFormHelpString);
            helpProvider.SetHelpString(ecTextBoxFindWhat, SILConvertersOffice13.Properties.Resources.ecTextBoxFindWhatHelpString);
            helpProvider.SetHelpString(ecTextBoxReplaceWith, SILConvertersOffice13.Properties.Resources.ecTextBoxReplaceWithHelpString);
#elif BUILD_FOR_OFF14
            helpProvider.SetHelpString(this, SILConvertersOffice10.Properties.Resources.FindReplaceFormHelpString);
            helpProvider.SetHelpString(ecTextBoxFindWhat, SILConvertersOffice10.Properties.Resources.ecTextBoxFindWhatHelpString);
            helpProvider.SetHelpString(ecTextBoxReplaceWith, SILConvertersOffice10.Properties.Resources.ecTextBoxReplaceWithHelpString);
#elif BUILD_FOR_OFF12
            helpProvider.SetHelpString(this, SILConvertersOffice07.Properties.Resources.FindReplaceFormHelpString);
            helpProvider.SetHelpString(ecTextBoxFindWhat, SILConvertersOffice07.Properties.Resources.ecTextBoxFindWhatHelpString);
            helpProvider.SetHelpString(ecTextBoxReplaceWith, SILConvertersOffice07.Properties.Resources.ecTextBoxReplaceWithHelpString);
#else
            helpProvider.SetHelpString(this, Properties.Resources.FindReplaceFormHelpString);
            helpProvider.SetHelpString(ecTextBoxFindWhat, Properties.Resources.ecTextBoxFindWhatHelpString);
            helpProvider.SetHelpString(ecTextBoxReplaceWith, Properties.Resources.ecTextBoxReplaceWithHelpString);
#endif
        }
예제 #2
0
        void FindReplace_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault)
        {
            if (!HookDocumentClose(Application.ActiveDocument))
            {
                return;
            }

            try
            {
                if (m_formFindReplace == null)
                {
                    WordFindReplaceDocument doc = new WordFindReplaceDocument(Application.ActiveDocument);
                    m_formFindReplace = new FindReplaceForm(doc);
                }

                m_formFindReplace.Show();
                m_formFindReplace.BringToFront();
            }
            catch (Exception ex)
            {
                DisplayException(ex);
            }
        }
예제 #3
0
		public FindReplaceForm(WordFindReplaceDocument doc)
		{
			InitializeComponent();
			m_doc = doc;

			// progressBar.Maximum = m_doc.DocumentEnd;

			// make sure these exist so don't throw an error later when we try to add to them
			if (Properties.Settings.Default.RecentFindWhat == null)
				Properties.Settings.Default.RecentFindWhat = new System.Collections.Specialized.StringCollection();
			else
				foreach (string str in Properties.Settings.Default.RecentFindWhat)
					comboBoxFindWhat.Items.Add(str);

			if (Properties.Settings.Default.RecentReplaceWith == null)
				Properties.Settings.Default.RecentReplaceWith = new System.Collections.Specialized.StringCollection();
			else
				foreach (string str in Properties.Settings.Default.RecentReplaceWith)
					comboBoxReplaceWith.Items.Add(str);

			helpProvider.SetHelpString(this, Properties.Resources.FindReplaceFormHelpString);
			helpProvider.SetHelpString(ecTextBoxFindWhat, Properties.Resources.ecTextBoxFindWhatHelpString);
			helpProvider.SetHelpString(ecTextBoxReplaceWith, Properties.Resources.ecTextBoxReplaceWithHelpString);
		}
 protected void DoWork(BackgroundWorker worker, WordFindReplaceDocument doc)
 {
     doc.Search(worker);
 }
예제 #5
0
		protected void DoWork(BackgroundWorker worker, WordFindReplaceDocument doc)
		{
			doc.Search(worker);
		}