private void CopyAllTablesBetweenTemplates(IDocument quoteSlipDoc)
        {
            var allTables = _document.GetTablesByNamePrefix(String.Empty);

            foreach (var tableName in allTables)
            {
                if (!quoteSlipDoc.TableExists(tableName))
                {
                    continue;
                }
                if (tableName.StartsWith("convert:"))
                {
                    continue;
                }

                _document.CopyTable(tableName);
                quoteSlipDoc.Activate();
                quoteSlipDoc.SelectTable(tableName);
                quoteSlipDoc.DeleteTable(tableName);
                quoteSlipDoc.InsertParagraphBreak();
                quoteSlipDoc.TypeText(RemovePrefix(tableName).Trim(), Constants.WordStyles.Bold);
                quoteSlipDoc.InsertParagraphBreak();
                quoteSlipDoc.PasteClipboardOriginalFormatting();
                quoteSlipDoc.InsertParagraphBreak();
            }
        }
Exemplo n.º 2
0
 // open the assoc. document
 public IWindow Open()
 {
     if (_document == null)
     {
         //_document = MdiApplication.GetObject().ItemOperators.OpenFile( _fileName );
     }
     return(_document.Activate());
 }
Exemplo n.º 3
0
        private void InsertUnderwritingInformations(IDocument quoteSlipDoc, IQuoteSlipSchedules schedule)
        {
            var s = quoteSlipDoc.GetBookmarkStartRange(Constants.WordBookmarks.UnderwritingStart);
            var e = quoteSlipDoc.GetBookmarkEndRange(Constants.WordBookmarks.UnderwritingEnd);

            quoteSlipDoc.DeleteRange(s, e);

            quoteSlipDoc.MoveCursorToStartOfBookmark(Constants.WordBookmarks.UnderwritingStart);

            var prefix           = "convert:" + schedule.Id;
            var tableNamesToCopy = _document.GetTablesByNamePrefix(prefix);

            var lastMode = "port";

            foreach (var tableName in tableNamesToCopy)
            {
                _document.CopyTable(tableName);

                quoteSlipDoc.Activate();

                if (tableName.Contains("landscape"))
                {
                    if (lastMode.Equals("port", StringComparison.OrdinalIgnoreCase))
                    {
                        lastMode = "landscape";
                        quoteSlipDoc.InsertLandscapePage("nLand");
                        quoteSlipDoc.MoveCursorToStartOfBookmark("nLand");
                    }
                }
                else
                {
                    if (lastMode.Equals("landscape", StringComparison.OrdinalIgnoreCase))
                    {
                        quoteSlipDoc.InsertPortraitPage("nPort");
                        quoteSlipDoc.MoveCursorToStartOfBookmark("nPort");
                    }
                    else
                    {
                        quoteSlipDoc.InsertParagraphBreak();
                    }

                    lastMode = "port"; //oh yeah ill have some port.  some tawny port
                }

                quoteSlipDoc.InsertParagraphBreak();
                var indexOfFirstPrefix = tableName.IndexOf('-') + 1;
                quoteSlipDoc.TypeText(tableName.Remove(0, indexOfFirstPrefix), Constants.WordStyles.Bold);
                //remove prefix
                quoteSlipDoc.PasteClipboardOriginalFormatting();
                quoteSlipDoc.InsertParagraphBreak();
            }
        }
Exemplo n.º 4
0
 public void ActivateDocument()
 {
     Document.Activate();
 }