Tag/
共65个网摘 [
1 2 3 ]
下一页 |
devnetwork收录,使用标签:have, written, a, word, addin, in, VSTO, 2005, which, when, loads, adds, a, custom, toolbar,时间:2008-4-25 13:52:51 | 相关网摘,我也收藏
have written a word addin in VSTO 2005 which when loads adds a custom toolbar
to word
http://www.dev-network.net/16/ca016c3393a0bfeb.php
devnetwork收录,使用标签:I, face, the, following, problem:, I, have, written, a, wrapper, library, that, exposes, specific, functionalities, of, the, Word, and, Excel, Automation, API, and, use, it, in, an, application, that, is, regularly, updated, on, the, client, side., It, is, clear, that, the, client, must, provide, the, Automation, Libraries, for, both, Word, and, Excel, which, come, with, the, Office, installation, CD, but, are, not, installed, by, default., Suppose, the, client, side, does, not, provide, those, libraries, due, to, uncomplete, Office, installation., What, I, wonder, is, if, there, is, a, decent, way, for, me, to, install, those, libraries, provided, their, version, is, the, same, as, the, Office, version, on, the, client, side, and, use, them, with, my, library, on, the, client, side, I, saw, that, the, libraries, are, installed, in, the, GAC., Is, it, a, good, way, to, check, if, the, libraries, are, present, on, the, client, side, during, the, setup, of, my, application, and, if, not, install, them, in, the, GAC, and, is, this, going, to, be, enough, for, the, whole, thing, to, start, working,时间:2008-4-25 13:51:12 | 相关网摘,我也收藏
I face the following problem: I have written a wrapper library that exposes specific functionalities of the Word and Excel Automation API and use it in an application that is regularly updated on the client side. It is clear that the client must provide the Automation Libraries for both Word and Excel which come with the Office installation CD but are not installed by default. Suppose the client side does not provide those libraries due to uncomplete Office installation. What I wonder is if there is a decent way for me to install those libraries provided their version is the same as the Office version on the client side, and use them with my library on the client side I saw that the libraries are installed in the GAC. Is it a good way to check if the libraries are present on the client side during the setup of my application and if not, install them in the GAC, and is this going to be enough for the whole thing to start working
http://www.dev-network.net/16/b0f60fbe0ce4255e.php
devnetwork收录,使用标签:The, windows, task, then, shows, the, default, application, icon, with, the, word, "Printing", beside, it,时间:2008-4-16 22:26:18 | 相关网摘,我也收藏
When the "pd.Print()" is executed, a dialog box appears which says "Printing, Page 1 of document".
The windows task then shows the default application icon with the word "Printing" beside it.
I would like to change that icon to the one for the application. Is there a way to do this My application settings specify a custom icon, but that doesn't make a difference.
http://www.dev-network.net/3/1e9923340e10a0be.php
seven2000收录,使用标签:vb, word,时间:2008-3-26 17:27:24 | 相关网摘,我也收藏
1 使用Shell函数直接调用
语法:Shell (pathname[,windowstyle]).Pathname是指要执行的程序的名字和任何必须的参数或命令行开关,可以包括目录和驱动器名;Windowstyle是执行程序的窗口风格的数字。
使用Shell调用Word比较简单,编程量小,但必须明确指定Word所在路径,这不利于移植,而且,不能对Word进行控制,不利于程序和Word之间的数据交换。
2 使用OLE自动化控制Microsoft Word
2.1 使用方法
(1)Word为OLE自动化提供一种称为“Basic”的对象,要在VB中控制Word ,首先要定义一个引用Word中“Basic”对象的对象变量:Dim Wordobj as Object
(2)将Word 中的“Basic”对象赋给该对象:Set Wordobj=CreateObject("Word.Basic")
(3)可以使用大多数WordBasic语句和函数控制Word或Word文档,使用方法和在Word宏中使用WordBasic指令的方法基本相同。
(4)关闭Word:Set Wordobj =Nothing。
注意:“Basic”对象不支持关闭它自己的一个方法。即若在OLE自动化中关闭了Word,则对象被置为Nothing,便不能再对对象进行操作,程序出错。
2.2 VB指令与WordBasic指令的差异
(1)有一些语句和函数不能使用,包括:控制结构,如While…Wend和If…Then…Else;声明语句,如Dim;定制对话框相关的语句:FileExit语句;笫楸淞孔魑问挠锞浠蚝?
(2)也有一些指令使用方法不同。①返回字符串以一个美元符($)结束的WordBasic函数的关键字必须括在方括号中。例如,在WordBasic宏中的GetBookmark$()语句:mark$=GetBookmark$("Address"),若用VB调用,必须这样写mark$=Wordobj.[Ge-tBookmark$]("Address")。②选择一个命令按钮用“True”,不选择用“False”
2.3 对OLE自动化的说明
Word可以为OLE自动化给另一个应用提供对象,但是它不能使用OLE自动化访问其它应用中的对象。例如:VB和Excel可以使用OLE自动化访问Word,但是Word不能使用OLE自动化访问它们。
3 在包容器中嵌入Word对象
在VB中,要访问在包容器中嵌入的Word对象,首先要在项目中插入对象。做法如下:在窗体中插入OLE控件,对象类型选择“MicrosoftWord图片”或“Microsoft Word文档”,再按“确定”。
然后用Object属性访问文档或图片,并使用WordBasic语句和函数作用于它。嵌入的对象必须在可被访问之前被激活,可以使用Action属性激活OLE控件。例如,使用下面指令访问一个嵌入在称为OLE1的OLE控件中的文档:
Dim Wordobj as Object
OLE1.Action =7
Set Wordobj =OLE1.Object.Application. WordBasic
其他方面,使用方法同OLE自动化。使用在包容器中嵌入的Word对象,Word显示的窗口大小、位置与OLE控件定义的大小、位置相同,而且工具栏显示位置与Word脱离。这一点与OLE自动化相比,是个不足。
总之,要想在Microsoft Visual Basic中控制Microsoft Word,最好使用OLE自动化,通过使用WordBasic指令对Word进行全面控制,而且,用户使用起来与使用Microsoft Word一样,非常方便。
http://www.gold98.net/artics/vb/200691787400.html
seven2000收录,使用标签:vb, word,时间:2008-3-26 17:20:55 | 相关网摘,我也收藏
在网上下载了大量htm教程,存放在"E:\ACM"下,除了htm文件外,还包含files文件夹,gif图片等等。阅读颇为麻烦,而且是繁体,需要转换。有些包含链接较多,影响阅读。转换成Word,阅读就方便多了。
以下宏在运行过程中,可能会导致当前Word文档假死,不要紧,等处理完ObjPath下的文件后会恢复正常。
解决步骤:
1、录制一个很简单的宏,审阅》繁转简,然后Office按钮,另存为》Word2003格式,另一个文件夹。结束录制。
2、录制第二个很简单的宏,打开刚才存至另一个文件夹下的Word2003格式的Word,开始录制,Office按钮,转换,结束录制。
3、利用Vb的FileSysytemObject对象,获取特点文件夹下的所有文件。
4、综合1,2,3,可得出如下代码。
http://hi.baidu.com/黑暗水印/blog/item/10bfd562fb5951dee7113a89.html
kogo2005收录,使用标签:java, word,时间:2007-12-5 14:36:03 | 相关网摘,我也收藏
想用java操作word文件?jacob是个不错的选择,也就是java-com桥,你可以在http://sourceforge.net/projects/jacob-project/下载,......现在该用到jacob.jar了,如果你自己修改过jar包的名字,用新改的jar包,如jacob_test.jar,这里统一称为jacob.jar。
首先在classpath中引入jacob.jar包,如果是web应用,WEB-INF的lib中也要加入jacob.jar包。
下面给一个例子:
类ReplaceWord.java
import com.jacob.com.*;
import com.jacob.activeX.*;
public class ReplaceWord {
public static void main(String[] args) {
ActiveXComponent app = new ActiveXComponent("Word.Application"); //启动word
String inFile = "C:\\test.doc"; //要替换的word文件
try {
app.setProperty("Visible", new Variant(false)); //设置word不可见
Dispatch docs = app.getProperty("Documents").toDispatch();
Dispatch doc = Dispatch.invoke(docs,"Open",Dispatch.Method,new Object[] { inFile, new Variant(false),new Variant(false) }, new int[1]).toDispatch(); //打开word文件,注意这里第三个参数要设为false,这个参数表示是否以只读方式打开,因为我们要保存原文件,所以以可写方式打开。
http://blog.csdn.net/janestone/archive/2007/12/04/1916825.aspx
共65个网摘 [
1 2 3 ]
下一页