perl-reading word document content

# Read word document content

# Program: Xing
# Time: 2010.3.19
# Blog: http://deepfuture.javaeye.com
# QQ: 782322192

use warnings;
use strict;
use Win32:: OLE;
use Win32:: OLE:: Const 'Microsoft Word';
my $ word = CreateObject Win32:: OLE 'Word.Application' or die $!;
$ Word-> ('Visible') = 1;
my $ id = 1;
while ($ id <20) (
my $ document = $ word-> Documents-> Open ("e: \ \ text \ \ 2.doc");
my $ paragraphs = $ document-> Paragraphs ($ id);
my $ myrange = $ paragraphs-> range;
my $ myfont = $ myrange-> Font-> Size;
my $ text = $ myrange-> Text;
# $ Text = encode ("gbk", decode ("utf-8", $ text));
print "$ text \ n";
print "$ myfont \ n";
# $ Myrange
# My $ pdffilename = "e: \ \ text \ \ $ id.pdf";
# $ Document-> saveas ((FileName => $ pdffilename, FileFormat => wdExportFormatPDF));
$ Id + +;
)
# $ Word-> quit ();

分类:Tech 时间:2010-03-09 人气:290
分享到:
blog comments powered by Disqus

相关文章

  • java call to action word to use com component summary (jacob) 2010-03-29

    import com.jacob.activeX.ActiveXComponent; import com.jacob.com.Dispatch; import com.jacob.com.Variant; /** * jacob Operation MSword class * @author */ public class WordBean { // word Documentation private Dispatch doc; // word Run the program object

  • Microsoft.AlphaImageLoader filters explain, jsp display the local picture 2010-04-20

    In the jsp to display the local picture Before uploading a file, usually we have a preview function, HTML + JS so we can deal with the next <script language="javascript" type="text/javascript"> function PreviewImg (imgFile) ( / /

  • Microsoft signed an agreement Joomla Contributor 2010-05-01

    Microsoft has signed the JCA (Joomla! Contributor Agreement), on behalf of some of Joomla can use Microsoft's code, and Microsoft's legal department GPL accepted norms. According to the official Joomla blog that Microsoft has signed the JCA (Joomla!

  • [Change] Apple vs. Microsoft peak 2010-07-01

    http://hi.baidu.com/robin_witheme/blog/item/45233df0c2e0eece7831aa34.html A long article on the technical aspects of the analysis than the two companies, however, tend to Microsoft the. From the user's point of view, Microsoft's affinity bad, and the

  • Bill Gates: Microsoft's Top Ten Mistakes I 2010-10-29

    With the phasing out of Bill Gates 31 years he was in charge of Microsoft, the end of an era, his merits and demerits of Microsoft will naturally become the industry, the media and even the personal comment on the object. Microsoft's board of directo

  • 10年MFC经历认识的Microsoft技术 2014-01-31

    自从2005年3月8日下午16时"十年MFC经历认识的Microsoft技术"以帖子的方式发表于CSDN论坛后,引起了许多网友得好评,使得笔者诚惶诚恐,考虑到该贴过长(人气指数为5000),因此转移到Blog上,许多网友对此帖的评语只好省略,在此鄙人谢过了!为感谢网友的支持,本人希望今后能发出新的帖子以回报网友对我的鼓励,再一次谢谢! 初识MFC 我最初知道MFC大概是在1993年,那个时候Visual C++还没面世,当时Microsoft的C++编译器还很弱,官方的名字是Micro

  • How to Reset or Change Microsoft Office 2007 Product License Key or Volume License Key (VLK) 2012-03-09

    You may need to alter or change Microsoft Office 2007 (aka 2007 Microsoft Office System programs and suites) product license key or volume license key (VLK) which also known as serial number or CD key. You can modify or change product key for 2007 Mi

  • C#基于Microsoft Speech SDK Version 5.1 的开发 2012-03-09

    //Microsoft Speech SDK Version 5.1 #endregion private SpeechLib.SpSharedRecoContext objRecoContext = null; #region ISpeechRecoGrammar说明 //The ISpeechRecoGrammar automation interface enables applications to manage the words and phrases for the SR engi

  • Romance of Three Kingdoms IBM Microsoft Oracle database family history of hair 2010-03-05

    Information technology can not develop without the continuous development of database technology from dbase, Foxbase, Foxpro, Access, the Microsoft SQL Server, Sybase SQL Server, Oracle, the database size increases, more and more powerful function. I

  • Microsoft continued to increase investment in China: China Development Group upgraded to Microsoft's Asia-Pacific R & D Group 2010-04-12

    Microsoft China R & D Group upgraded to the Asia-Pacific R & D Group 2010-01-27 09:56 Kevin Sina Technology Jan. 25 afternoon news, Microsoft announced that Microsoft, based in Beijing, Microsoft China R & D Group was renamed as the Asia-Pacif

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.290 (s). 12 q(s)