VBScript找到.apk并导入前景 [英] Vbscript find .apk and import outlook

查看:68
本文介绍了VBScript找到.apk并导入前景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我编写了一个脚本,该脚本可以找到.apk并在Outlook中自动导入.

但是我有一个问题.我可以设置4个路径文件夹.然后脚本查找路径文件夹并找到apk.

但是当此脚本可以找到.apk文件夹时,程序结束.

该脚本看起来没有其他路径.

Hi everyone,

I wrote a script which can find the .apk and import aoutomaticly in outlook.

But i have a problem. i can set 4 path folder. And the script look path folders and find the apk.

But when this script can find an .apk folders, the program finish.

This script doesn''t look another path.

On Error Resume Next
	Set objFSO = CreateObject("Scripting.FileSystemObject")
	Set objnet = CreateObject("wscript.network")
	Set olkApp = CreateObject("Outlook.Application") 
	Set objFolder = objFSO.GetFolder("C:\Documents and Settings\" & objnet.UserName & "\")
	Set objFolder = objFSO.GetFolder("C:\Documents and Settings\" & objnet.UserName & "\Local Settings\Application Data\Microsoft\Outlook")
	Set objFolder = objFSO.GetFolder("C:\Documents and Settings\" & objnet.UserName & "\Belgelerim\mail")
	Set objFolder = objFSO.GetFolder("C:\Documents and Settings\" & objnet.UserName & "\AppData\Local\Microsoft\Outlook")
	Set objFolder = objFSO.GetFolder("C:\Documents and Settings\" & objnet.UserName & "\Belgelerim\mailbox")
     For Each objFile in objFolder
		 If LCase(objFSO.GetExtensionName(objFile.Name)) = "pst" Then
			olkApp.Session.AddStore objFile.Path
	 End If
Next
MsgBox "Done"



例如,此脚本找到路径.apk文件夹



For example, this script find the path .apk folder

(Set objFolder = objFSO.GetFolder("C:\Documents and Settings\" & objnet.UserName & "\")) 


而且没有其他路径.

如何解决这个问题.

感谢您的帮助.


And doesn''t look another paths.

How to solve this problem.

Thanks for any helping.

推荐答案

您的代码现在仅使用最后一个文件夹,而每个Set objFolder语句都将覆盖先前的值.因此,实际上只有语句
The way your code is now only the last folder is used, with each Set objFolder statement you are overwriting the previous value. So in effect only the files in the folder from the statement
Set objFolder = objFSO.GetFolder("C:\Documents and Settings\" & objnet.UserName & "\Belgelerim\mailbox")

.

为了查看所有文件夹,请执行文件搜索代码

are searched.

In order to look in all the folders execute the file searching code

For Each objFile in objFolder
	If LCase(objFSO.GetExtensionName(objFile.Name)) = "pst" Then
		olkApp.Session.AddStore objFile.Path
	End If
Next


对于每个set objFolder语句.

注意:您不必将代码重复几次,而应将其放在单独的过程中.


for each set objFolder statement.

Note: Instead of repeating the code several times you should place it in a separate procedure.


这篇关于VBScript找到.apk并导入前景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆