Example #1
0
        public void setFeatures(Word.Application oApp, ClassFont oFont = null, String strNoChange = "(保持原值不变)")
        {
            app = oApp;
            try
            {
                doc = app.ActiveDocument;
            }
            catch (System.Exception ex)
            {
                doc = null;
            }
            finally
            {
            }

            m_strNoChange = strNoChange;

            if (oFont != null)
            {
                oFont.SelCopy2(inFont);
                // inFont.clone(oFont);
            }

            return;
        }
Example #2
0
        private void Data2UI(ClassFont oFont = null)
        {
            if (oFont != null)
            {
                oFont.SelCopy2(inFont);
            }

            if (inFont.isSet(ClassFont.euMembers.NameFarEast))
            {
                cmbChineseFonts.Text = inFont.NameFarEast;
            }
            else
            {
                cmbChineseFonts.Text = m_strNoChange;
            }

            if (inFont.isSet(ClassFont.euMembers.NameAscii))
            {
                cmbAsciiFonts.Text = inFont.NameAscii;
            }
            else
            {
                cmbAsciiFonts.Text = m_strNoChange;
            }

            if (inFont.isSet(ClassFont.euMembers.Size))
            {
                cmbFontSize.Text = "" + inFont.Size;
            }
            else
            {
                cmbFontSize.Text = m_strNoChange;
            }

            //
            if (inFont.isSet(ClassFont.euMembers.Bold))
            {
                if (inFont.Bold != 0) // true
                {
                    chkFontBold.CheckState = CheckState.Checked;
                }
                else
                {
                    chkFontBold.CheckState = CheckState.Unchecked;
                }
            }
            else
            {
                chkFontBold.CheckState = CheckState.Indeterminate;
            }

            //
            if (inFont.isSet(ClassFont.euMembers.Italic))
            {
                if (inFont.Italic != 0) // true
                {
                    chkFontItalic.CheckState = CheckState.Checked;
                }
                else
                {
                    chkFontItalic.CheckState = CheckState.Unchecked;
                }
            }
            else
            {
                chkFontItalic.CheckState = CheckState.Indeterminate;
            }

            return;
        }