Beispiel #1
0
 internal Paragraph(WordDocument owner, int offset, int length,
     WordDocument.FileCharacterPosition fcp, PapxInFkps papxInFkps)
 {
     this.owner = owner;
     this.Offset = offset;
     this.Length = length;
     this.FileCharacterPosition = fcp;
     this.PapxInFkps = papxInFkps;
 }
 internal CharacterFormatting(WordDocument owner, int offset, int length,
     WordDocument.FileCharacterPosition fcp, Chpx chpx)
 {
     this.owner = owner;
     this.Offset = offset;
     this.Length = length;
     this.FileCharacterPosition = fcp;
     this.Chpx = chpx;
 }
Beispiel #3
0
        static void Main(string[] args)
        {
            if(args.Length == 0)
            {
                Console.WriteLine("USAGE: WordFileDrop.exe <doc-file>");
                return;
            }

            string filename = args[0];
            using (CompoundFileSystem system = new CompoundFileSystem(filename))
            {
                WordDocument doc = new WordDocument();
                doc.Load(system);

                foreach (Paragraph p in doc.Paragraphs)
                {
                    string text = p.GetText();
                    Console.WriteLine("{0}/{1}, {3}: {2}",
                        p.Offset, p.Length, Escape(text),
                        p.Style.Name);
                }
                Console.WriteLine();
                foreach (StyleDefinition s in doc.StyleDefinitions)
                {
                    Console.WriteLine("Style {0}: {1}", s.Name, s.IsTextStyle);

                }
                Console.WriteLine();
                foreach (CharacterFormatting f in doc.Formattings)
                {
                    string text = f.GetText();
                    StyleDefinition style = f.Style;
                    Console.WriteLine("Format {0}/{1}, {3}: {2}",
                        f.Offset, f.Length, Escape(text),
                        style != null ? style.Name : "-");
                }
            }
        }
 internal StyleDefinition(WordDocument owner, STD std)
 {
     this.owner = owner;
     this.std = std;
 }