|
查看: 1249|回复: 5
|
VB .NET 超难的问题
[复制链接]
|
|
|
当user click Save button 的时候用VB .NET将ms word/excel/power point, notepad...等等 close掉
example:
user open ms excel(abc.xls),key-in了一些data,然后click Save button接着VB .NET detect到user run Save event就将ms excel 关掉。而且是将那个abc.xls 关掉不是将全部ms excel关掉。
[ 本帖最后由 bearish 于 29-11-2008 11:32 AM 编辑 ] |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 25-11-2008 11:03 AM
|
显示全部楼层
我是用VB .NET 的system.windows.form.listview 来打开里面的file(s)
listview 里面的file(s)是store在server而不是在user的pc
里面的file(s)除了ms office 以外还有其他的档案
其实我要的是user打开document的时候,当user按save,我的VB .NET program就会去detect到底哪一个document按save,接着就将那个document关掉, 将那个document送回server
当user按save的时候为何要将那个document强行关掉是因为接下来需要run一些method,如不将它close掉的话就无法执行接下来的method
[ 本帖最后由 bearish 于 25-11-2008 11:05 AM 编辑 ] |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 7-1-2009 04:16 PM
|
显示全部楼层
不知哪位大大能给予提示
如何 Display Chinese Characters on ListView Control in VB .Net |
|
|
|
|
|
|
|
|
|
|
发表于 18-3-2009 12:27 AM
|
显示全部楼层
回复 3# bearish 的帖子
|
普通windows 都应该刻意执行中文显现,我以前到control panel set chinese prc 就能读取中文了。我相信其他unicode都是一样的。 |
|
|
|
|
|
|
|
|
|
|
发表于 18-3-2009 12:50 AM
|
显示全部楼层
您第一个问题会比较辣手,我试过detect event handle on crystal report.
我有几个建议,如果没记错的话,vb.net 里有OFFICE COMPONENT。 add that component to display office document. 所以你就可以轻易detect event on office document.
不然你可以试用VBA。
我帮你找了几个catch office event 的 code。 没机会测试,您看一看吧。
http://msdn.microsoft.com/en-us/library/aa168477.aspx
fire a excel
Sub XLTEST(ByVal ProcessFile As String)
Dim XLApp As New Excel.Application
Dim XLBook As Excel.Workbook = XLApp.Workbooks.Open(ProcessFile)
Try
Dim SheetName As String
SheetName = "Sheet1"
XLApp.Visible = True ' for debugging
XLApp.Run(SheetName & ".CommandButton1_Click")
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
XLBook.Close()
XLApp.Quit()
XLBook = Nothing
XLApp = Nothing
End Sub |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 18-3-2009 11:09 AM
|
显示全部楼层
原帖由 zhixuen 于 18-3-2009 12:50 AM 发表 
您第一个问题会比较辣手,我试过detect event handle on crystal report.
我有几个建议,如果没记错的话,vb.net 里有OFFICE COMPONENT。 add that component to display office document. 所以你就可以轻易detec ...
其实VBA是已经写好了也可以RUN料,但VBA这功能是用在OFFICE Application里地。如果是通过第三方的软体如: 'VB.NET'来handle OFFICE Application 里的Save或Save As Event的话就比较难瓜。而且对手还是OFFICE 2007(还没尝试将OFFICE Component Add进VB.NET里用)
不过还是要谢谢您 |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|