关于快速预览doc文件的方法

新手涉及到的教学或入门贴,推荐新手必看,版主维护
头像
webyjh
帖子: 225
注册时间: 2008-11-06 15:18
来自: 中国

Re: 关于快速预览doc文件的方法

#16

帖子 webyjh » 2012-03-12 22:30

eexpress 写了:● aw wv
软件包: wv
新: 是
状态: 未安装
版本号: 1.2.9-2
优先级: 可选
部分: universe/text
维护者: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
未压缩尺寸: 406 k
依赖于: libc6 (>= 2.4), libglib2.0-0 (>= 2.12.0), libgsf-1-114 (>= 1.14.8),
libwmf0.2-7 (>= 0.2.8.4), libwv-1.2-4 (>= 1.2.9)
建议: texlive, ghostscript, elinks | links | lynx, imagemagick, gv |
postscript-viewer
冲突: mswordview, mswordview, wv
代替: mswordview, mswordview
提供: mswordview

查看的多吧。
多谢,就是不知道WV怎么用?
头像
自由建客
帖子: 13468
注册时间: 2008-07-30 23:21
系统: Debian stable AMD64

Re: 关于快速预览doc文件的方法

#17

帖子 自由建客 » 2012-03-13 2:32

大不溜微?微大不溜?
附件
1.png
1.png (20.26 KiB) 查看 2639 次
头像
webyjh
帖子: 225
注册时间: 2008-11-06 15:18
来自: 中国

Re: 关于快速预览doc文件的方法

#18

帖子 webyjh » 2012-03-13 8:15

自由建客 写了:大不溜微?微大不溜?
好像应该是 w v 软件中心有这样的软件,但是好像不是预览文件用的
头像
TeliuTe
论坛版主
帖子: 7675
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

Re: 关于快速预览doc文件的方法

#19

帖子 TeliuTe » 2012-03-13 8:49

有些邮箱里有预览功能,不知道是本地实现的还是服务器上发送过来的
头像
webyjh
帖子: 225
注册时间: 2008-11-06 15:18
来自: 中国

Re: 关于快速预览doc文件的方法

#20

帖子 webyjh » 2012-03-13 10:27

TeliuTe 写了:有些邮箱里有预览功能,不知道是本地实现的还是服务器上发送过来的
是学生的作业文件,一大堆的doc文件,一个个打开,批完了要关闭再打开下一个,操作是机械的重复,所以想偷点懒,提高一下工作效率的。
谢宝良
帖子: 1983
注册时间: 2010-05-01 21:23

Re: 关于快速预览doc文件的方法

#21

帖子 谢宝良 » 2012-03-13 12:23

你还是学会怎样使用宏吧。你要是实在写不出,过几天我帮你写。但你得懂一些基本的东西。
对于打开doc文件,你的选择不会太多。ooo或永中或vbox一个xp。
谢宝良
帖子: 1983
注册时间: 2010-05-01 21:23

Re: 关于快速预览doc文件的方法

#22

帖子 谢宝良 » 2012-03-13 17:57

sub Main



Dim oDispatcher as object
Dim Cursor As Object
Dim oDoc1 As Object
Dim oDoc2 As Object
Dim Url As String
Dim oFrame1 As Object
Dim oFrame2 As Object
Dim Dummy() 'An (empty) array of PropertyValues
Dim path as String



rem 把的你的doc文件目录代替 "file:///home/xbl/Documents/hebing/"。注rem 意目录的开头是 file:///


path= "file:///home/xbl/Documents/hebing/"



oDoc1 = StarDesktop.loadComponentFromURL("private:factory/swriter", "_hidden", 0,Dummy)
oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
Dim filename as string
Dim n as Integer
m = 0
filename=dir$(path & "*.doc",0)

Dim args1(0) as new com.sun.star.beans.PropertyValue
do
if filename="" then
exit do
else
m=m+1
oDoc2=StarDesktop.loadComponentFromURL(path & filename,"_hidden",0,Dummy)
oFrame2 = oDoc2.CurrentController.Frame
oDispatcher.executeDispatch(oFrame2, ".uno:SelectAll", "", 0, Array())
oDispatcher.executeDispatch(oFrame2, ".uno:Copy", "", 0, Array())
oFrame1 = oDoc1.CurrentController.Frame
oDispatcher.executeDispatch(oFrame1, ".uno:Paste", "", 0, Array())
args1(0).Name = "Text"
args1(0).Value = " "&"nnn"&str(m)&" "
oDispatcher.executeDispatch(oFrame1, ".uno:InsertText", "", 0, args1())
oDispatcher.executeDispatch(oFrame1, ".uno:InsertPara", "", 0, Array())

oDoc2.close(true)
filename=dir$
end if
loop

End Sub


每个文件的结尾是 nnn
谢宝良
帖子: 1983
注册时间: 2010-05-01 21:23

Re: 关于快速预览doc文件的方法

#23

帖子 谢宝良 » 2012-03-16 13:19

这是改进后的版本。我自己也使用,我也是老师。出试卷方便多了。
path= "file:///home/xbl/Documents/hebing/"
把path换成你的目录就可以了。





sub Main
Dim oDispatcher as object
Dim Cursor As Object
Dim oDoc1 As Object
Dim oDoc2 As Object
Dim Url As String
Dim oFrame1 As Object
Dim oFrame2 As Object
Dim Dummy() 'An (empty) array of PropertyValues
Dim path as String



rem 把的你的doc文件目录代替 "file:///home/xbl/Documents/hebing/"。注意目录的开头是 file:///


path= "file:///home/xbl/Documents/hebing/"



oDoc1 = StarDesktop.loadComponentFromURL("private:factory/swriter", "_hidden", 0,Dummy)
oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
Dim filename as string
Dim n as Integer
m = 0
f=dir$(path & "*.doc",0)


Dim args1(0) as new com.sun.star.beans.PropertyValue
do
if f="" then
exit do
else
m=m+1
document=StarDesktop.loadComponentFromURL(path & f,"_hidden",0,Dummy)
frame = document.CurrentController.Frame

f = "file:///home/xbl/Documents/hebing/odt/" & str(m) &".odt"

document.storeToUrl (f, Array())
document.close(true)
f=dir$
end if
loop


path="file:///home/xbl/Documents/hebing/odt/"
m = 0
filename=dir$(path & "*.odt",0)


do
if filename="" then
exit do
else
m=m+1
oDoc2=StarDesktop.loadComponentFromURL(path & filename,"_hidden",0,Dummy)
oFrame2 = oDoc2.CurrentController.Frame
oDispatcher.executeDispatch(oFrame2, ".uno:SelectAll", "", 0, Array())
oDispatcher.executeDispatch(oFrame2, ".uno:Copy", "", 0, Array())
oFrame1 = oDoc1.CurrentController.Frame

args1(0).Name = "Text"
args1(0).Value = " "&"nnn"&str(m)&" "
oDispatcher.executeDispatch(oFrame1, ".uno:InsertText", "", 0, args1())
oDispatcher.executeDispatch(oFrame1, ".uno:Paste", "", 0, Array())
oDispatcher.executeDispatch(oFrame1, ".uno:InsertPara", "", 0, Array())

oDoc2.close(true)
filename=dir$
end if
loop

End Sub
头像
webyjh
帖子: 225
注册时间: 2008-11-06 15:18
来自: 中国

Re: 关于快速预览doc文件的方法

#24

帖子 webyjh » 2012-03-21 16:56

谢宝良 写了:这是改进后的版本。我自己也使用,我也是老师。出试卷方便多了。
path= "file:///home/xbl/Documents/hebing/"
把path换成你的目录就可以了。





sub Main
Dim oDispatcher as object
Dim Cursor As Object
Dim oDoc1 As Object
Dim oDoc2 As Object
Dim Url As String
Dim oFrame1 As Object
Dim oFrame2 As Object
Dim Dummy() 'An (empty) array of PropertyValues
Dim path as String



rem 把的你的doc文件目录代替 "file:///home/xbl/Documents/hebing/"。注意目录的开头是 file:///


path= "file:///home/xbl/Documents/hebing/"



oDoc1 = StarDesktop.loadComponentFromURL("private:factory/swriter", "_hidden", 0,Dummy)
oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
Dim filename as string
Dim n as Integer
m = 0
f=dir$(path & "*.doc",0)


Dim args1(0) as new com.sun.star.beans.PropertyValue
do
if f="" then
exit do
else
m=m+1
document=StarDesktop.loadComponentFromURL(path & f,"_hidden",0,Dummy)
frame = document.CurrentController.Frame

f = "file:///home/xbl/Documents/hebing/odt/" & str(m) &".odt"

document.storeToUrl (f, Array())
document.close(true)
f=dir$
end if
loop


path="file:///home/xbl/Documents/hebing/odt/"
m = 0
filename=dir$(path & "*.odt",0)


do
if filename="" then
exit do
else
m=m+1
oDoc2=StarDesktop.loadComponentFromURL(path & filename,"_hidden",0,Dummy)
oFrame2 = oDoc2.CurrentController.Frame
oDispatcher.executeDispatch(oFrame2, ".uno:SelectAll", "", 0, Array())
oDispatcher.executeDispatch(oFrame2, ".uno:Copy", "", 0, Array())
oFrame1 = oDoc1.CurrentController.Frame

args1(0).Name = "Text"
args1(0).Value = " "&"nnn"&str(m)&" "
oDispatcher.executeDispatch(oFrame1, ".uno:InsertText", "", 0, args1())
oDispatcher.executeDispatch(oFrame1, ".uno:Paste", "", 0, Array())
oDispatcher.executeDispatch(oFrame1, ".uno:InsertPara", "", 0, Array())

oDoc2.close(true)
filename=dir$
end if
loop

End Sub
非常感谢,前几天出于工作原因又装回了win7,所以现在才回复,感谢您
回复