private void cellPropertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IHTMLTableCell selectedElement = builder.GetSelectedTableCellElement();

            try
            {
                TableCell            selectedCell      = builder.GetSelectedTableCell();
                CellPropertiesDialog dlgCellProperties = new CellPropertiesDialog();

                if (selectedCell.BackgroundColor != null)
                {
                    dlgCellProperties.CellBackgroundColor = ConvertRgbToColor(selectedCell.BackgroundColor);
                }
                if (selectedCell.BorderColor != null)
                {
                    dlgCellProperties.CellBorderColor = ConvertRgbToColor(selectedCell.BorderColor);
                }
                if (selectedCell.BorderSize != null)
                {
                    dlgCellProperties.CellBorderSize = selectedCell.BorderSize;
                }
                if (selectedCell.Height != null)
                {
                    dlgCellProperties.CellHeight = selectedCell.Height;
                }
                if (selectedCell.Width != null)
                {
                    dlgCellProperties.CellWidth = selectedCell.Width;
                }
                if (selectedCell.Rowspan != null)
                {
                    dlgCellProperties.Rowspan = selectedCell.Rowspan;
                }
                if (selectedCell.Colspan != null)
                {
                    dlgCellProperties.Colspan = selectedCell.Colspan;
                }

                dlgCellProperties.ShowDialog();
                if (dlgCellProperties.DialogResult == DialogResult.OK)
                {
                    builder.ChangeCellProperty(selectedElement, CellProperties.BackgroundColor,
                                               ConvertColorToRgb(dlgCellProperties.CellBackgroundColor));
                    builder.ChangeCellProperty(selectedElement, CellProperties.BorderColor,
                                               ConvertColorToRgb(dlgCellProperties.CellBorderColor));
                    builder.ChangeCellProperty(selectedElement, CellProperties.BorderSize,
                                               dlgCellProperties.CellBorderSize.ToString());
                    builder.ChangeCellProperty(selectedElement, CellProperties.Height,
                                               dlgCellProperties.CellHeight.ToString());
                    builder.ChangeCellProperty(selectedElement, CellProperties.Width,
                                               dlgCellProperties.CellWidth.ToString());
                    builder.ChangeCellProperty(selectedElement, CellProperties.Rowspan,
                                               dlgCellProperties.Rowspan.ToString());
                    builder.ChangeCellProperty(selectedElement, CellProperties.Colspan,
                                               dlgCellProperties.Colspan.ToString());

                    modifiedDocument = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        private void cellPropertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IHTMLTableCell selectedElement = builder.GetSelectedTableCellElement();
            try
            {
                TableCell selectedCell = builder.GetSelectedTableCell();
                CellPropertiesDialog dlgCellProperties = new CellPropertiesDialog();

                if (selectedCell.BackgroundColor != null)
                {
                    dlgCellProperties.CellBackgroundColor = ConvertRgbToColor(selectedCell.BackgroundColor);
                }
                if (selectedCell.BorderColor != null)
                {
                    dlgCellProperties.CellBorderColor = ConvertRgbToColor(selectedCell.BorderColor);
                }
                if (selectedCell.BorderSize != null)
                {
                    dlgCellProperties.CellBorderSize = selectedCell.BorderSize;
                }
                if (selectedCell.Height != null)
                {
                    dlgCellProperties.CellHeight = selectedCell.Height;
                }
                if (selectedCell.Width != null)
                {
                    dlgCellProperties.CellWidth = selectedCell.Width;
                }
                if (selectedCell.Rowspan != null)
                {
                    dlgCellProperties.Rowspan = selectedCell.Rowspan;
                }
                if (selectedCell.Colspan != null)
                {
                    dlgCellProperties.Colspan = selectedCell.Colspan;
                }

                dlgCellProperties.ShowDialog();
                if (dlgCellProperties.DialogResult == DialogResult.OK)
                {
                    builder.ChangeCellProperty(selectedElement, CellProperties.BackgroundColor,
                        ConvertColorToRgb(dlgCellProperties.CellBackgroundColor));
                    builder.ChangeCellProperty(selectedElement, CellProperties.BorderColor,
                        ConvertColorToRgb(dlgCellProperties.CellBorderColor));
                    builder.ChangeCellProperty(selectedElement, CellProperties.BorderSize,
                        dlgCellProperties.CellBorderSize.ToString());
                    builder.ChangeCellProperty(selectedElement, CellProperties.Height,
                        dlgCellProperties.CellHeight.ToString());
                    builder.ChangeCellProperty(selectedElement, CellProperties.Width,
                        dlgCellProperties.CellWidth.ToString());
                    builder.ChangeCellProperty(selectedElement, CellProperties.Rowspan,
                        dlgCellProperties.Rowspan.ToString());
                    builder.ChangeCellProperty(selectedElement, CellProperties.Colspan,
                        dlgCellProperties.Colspan.ToString());

                    modifiedDocument = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }