![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi there, I have an email sent to me when a file has finished backing up on
my server. It is sent with the Subject of the email as follows: Status change for *file.xyz* I am trying to create a script that processes this Subject line and then launches an FTP client with the right parameters in order to download the backup file. Currently I am not passing the parameters as I cannot get it to work yet. I have a fair bit of experience with C/C++ but am a total beginner to VBA, I was wondering if somebody could help me as to why this script isnt working. Sub StartFTPTransfer(TheEMail As Outlook.MailItem) Dim Subject As String Subject = TheEMail.Subject Dim SubjectArray() As String For Arrayify = 1 To Len(Subject) SubjectArray = Mid(Subject, Arrayify, 1) Next Arrayify Dim i As Integer i = 0 Do Until SubjectArray(i) = "*" i = i + 1 Loop Dim FileName As String Do Until SubjectArray(i) = "*" FileName = FileName & SubjectArray(i) i = i + 1 Loop Dim stAppName As String stAppName = "D:\Program Files\FlashFXP\FlashFXP.exe" Call Shell(stAppName, vbMaximizedFocus) End Sub |
Ads |
#2
|
|||
|
|||
![]()
Sorry I forgot to say that it compiles fine in the Visual Basic window that
opens when you select 'Tools\Macro\Visual Basic Editor'. However, when the rule finds an email and runs it, the script does nothing (or at least it isnt opening any windows/...) Thanks again |
#3
|
|||
|
|||
![]()
Let's first rule out your code and see if the rule itself isn't firing.
Comment out everything and add a MsgBox "Hello world" line. If that works, uncomment your code and try loading Notepad.exe with the Shell call. Let me know what you find. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "ChrisCharles" wrote: Hi there, I have an email sent to me when a file has finished backing up on my server. It is sent with the Subject of the email as follows: Status change for *file.xyz* I am trying to create a script that processes this Subject line and then launches an FTP client with the right parameters in order to download the backup file. Currently I am not passing the parameters as I cannot get it to work yet. I have a fair bit of experience with C/C++ but am a total beginner to VBA, I was wondering if somebody could help me as to why this script isnt working. Sub StartFTPTransfer(TheEMail As Outlook.MailItem) Dim Subject As String Subject = TheEMail.Subject Dim SubjectArray() As String For Arrayify = 1 To Len(Subject) SubjectArray = Mid(Subject, Arrayify, 1) Next Arrayify Dim i As Integer i = 0 Do Until SubjectArray(i) = "*" i = i + 1 Loop Dim FileName As String Do Until SubjectArray(i) = "*" FileName = FileName & SubjectArray(i) i = i + 1 Loop Dim stAppName As String stAppName = "D:\Program Files\FlashFXP\FlashFXP.exe" Call Shell(stAppName, vbMaximizedFocus) End Sub |
#4
|
|||
|
|||
![]()
Thanks for your help, I managed to sort it by signing the script.
I have also completely rewritten the script as I realised what a stupid way of doing the task it was. Its working fine now, thanks again |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlk 2k3 Script: Saving Excel File programticaly from OUTLOOK SCRIPT | news.microsoft.com | Outlook and VBA | 3 | November 22nd 06 03:33 PM |
Run A SCRIPT - Select Script EMPTY | mitupan116 | Outlook and VBA | 1 | November 2nd 06 09:36 PM |
Help with a script | batesharold@hotmail.com | Outlook and VBA | 7 | September 19th 06 06:16 AM |
Rule 'run a script' not running my script | s.parsley@ntlworld.com | Outlook and VBA | 3 | May 30th 06 12:09 PM |
"Run a script" rule triggers but script does not execute | Trey Shaffer | Outlook and VBA | 7 | April 7th 06 11:34 PM |