PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Re: Automatically backing up outlook pst everytime I exit outlook

Reply

Re: Automatically backing up outlook pst everytime I exit outlook

 
Thread Tools Rate Thread
Old 04-08-2004, 07:32 PM   #1
Brian S.
Guest
 
Posts: n/a
Default Re: Automatically backing up outlook pst everytime I exit outlook


I would try the outlook pst backup tool available on the microsoft website
at
http://www.microsoft.com/downloads/...&DisplayLang=en

You can use this tool with Office 2000 and Office 2002 (XP).
Configure the add in to backup each PST when the users exit to the machine
with the DVD drive.

As a side note, the reason your script isn't working is because the pst file
isn't closed until after the quit event. The tool from Microsoft should
work better for you.


"dev_kh" <devkh@discussions.microsoft.com> wrote in message
news:CEE7DFE9-F693-4FEC-A0BF-E9A64B94C7B5@microsoft.com...
>
> Hi,
>
> we have a small office setup with few peer to peer linked win xp machines.

Only one machine has dvd drive where daily backups occur every night. Our
outlook pst files are very important and need to be backed up every night.
>
> So I need to create a small snippet in outlook which will backup my pst

file from my machine to the backup machine everytime I close outlook. To
do so, I create a FileSystemObject which copies and pastes the outlook.pst
file on application_quit event. My problem is that whenever it tries to
backup, it gives the following error:
>
> "Method 'Copy' of object 'IFile' failed."
>
> Please note, this code works fine if I try to copy and past someother file

which outlook is not using, for e.g. oldOutlook.pst.
> My guess is that maybe the outlook.pst file is still locked which is

causing this error... anyway to get around it...or any other idea to resolve
this issue. (please see code below)
>
> Thanks
> Dev
> ==========
> Private Sub Application_Quit()
> BackupPST
> End Sub
>
> Sub BackupPST()
> Dim objFileSystem
> Dim f2
> Dim strSource As String
> Dim strDestination As String
>
> strSource= "D:\Outlook\Outlook.pst"
> strDestination = "\\Backup\outlook\user\dev\Outlook.pst"
>
> 'Create a file system object for file handling
> Set objFileSystem = CreateObject("Scripting.FileSystemObject")
>
> 'Copy the outlook files to backup
> Set f2 = objFileSystem.getfile(strSource)
>
> 'Backup the file to the specified location
> f2.Copy (strDestination) 'This is where the error occurs!!!!
> End Sub



  Reply With Quote
Old 04-08-2004, 07:49 PM   #2
=?Utf-8?B?ZGV2X2to?=
Guest
 
Posts: n/a
Default Re: Automatically backing up outlook pst everytime I exit outlook

Thanks Brian, I have already installed this tool to see if it meets our
needs. The problem with this tool is:

If I unchek the reminder and exit the outlook, it does backup once. But If
I reload outlook and exit again, it does not backup..

So the only way to make it backup time I exit is to have that reminder
checkbox checked.. which is a distraction.

Is there any way to make this tool backup my pst files everytime I exit
without prompting me.

I wish I could get this addin's source code and tweak it a little..

Any ideas..
dev

"Brian S." wrote:

> I would try the outlook pst backup tool available on the microsoft website
> at
> http://www.microsoft.com/downloads/...&DisplayLang=en
>
> You can use this tool with Office 2000 and Office 2002 (XP).
> Configure the add in to backup each PST when the users exit to the machine
> with the DVD drive.
>
> As a side note, the reason your script isn't working is because the pst file
> isn't closed until after the quit event. The tool from Microsoft should
> work better for you.
>
>
> "dev_kh" <devkh@discussions.microsoft.com> wrote in message
> news:CEE7DFE9-F693-4FEC-A0BF-E9A64B94C7B5@microsoft.com...
> >
> > Hi,
> >
> > we have a small office setup with few peer to peer linked win xp machines.

> Only one machine has dvd drive where daily backups occur every night. Our
> outlook pst files are very important and need to be backed up every night.
> >
> > So I need to create a small snippet in outlook which will backup my pst

> file from my machine to the backup machine everytime I close outlook. To
> do so, I create a FileSystemObject which copies and pastes the outlook.pst
> file on application_quit event. My problem is that whenever it tries to
> backup, it gives the following error:
> >
> > "Method 'Copy' of object 'IFile' failed."
> >
> > Please note, this code works fine if I try to copy and past someother file

> which outlook is not using, for e.g. oldOutlook.pst.
> > My guess is that maybe the outlook.pst file is still locked which is

> causing this error... anyway to get around it...or any other idea to resolve
> this issue. (please see code below)
> >
> > Thanks
> > Dev
> > ==========
> > Private Sub Application_Quit()
> > BackupPST
> > End Sub
> >
> > Sub BackupPST()
> > Dim objFileSystem
> > Dim f2
> > Dim strSource As String
> > Dim strDestination As String
> >
> > strSource= "D:\Outlook\Outlook.pst"
> > strDestination = "\\Backup\outlook\user\dev\Outlook.pst"
> >
> > 'Create a file system object for file handling
> > Set objFileSystem = CreateObject("Scripting.FileSystemObject")
> >
> > 'Copy the outlook files to backup
> > Set f2 = objFileSystem.getfile(strSource)
> >
> > 'Backup the file to the specified location
> > f2.Copy (strDestination) 'This is where the error occurs!!!!
> > End Sub

>
>
>

  Reply With Quote
Old 04-08-2004, 09:13 PM   #3
Brian S.
Guest
 
Posts: n/a
Default Re: Automatically backing up outlook pst everytime I exit outlook

I know the messages are annoying. I don't know how to work around them
either.


"dev_kh" <devkh@discussions.microsoft.com> wrote in message
news:BEEC74D6-1BBC-4955-A54D-5EB4EA94C70E@microsoft.com...
> Thanks Brian, I have already installed this tool to see if it meets our
> needs. The problem with this tool is:
>
> If I unchek the reminder and exit the outlook, it does backup once. But

If
> I reload outlook and exit again, it does not backup..
>
> So the only way to make it backup time I exit is to have that reminder
> checkbox checked.. which is a distraction.
>
> Is there any way to make this tool backup my pst files everytime I exit
> without prompting me.
>
> I wish I could get this addin's source code and tweak it a little..
>
> Any ideas..
> dev
>
> "Brian S." wrote:
>
> > I would try the outlook pst backup tool available on the microsoft

website
> > at
> >

http://www.microsoft.com/downloads/...&DisplayLang=en
> >
> > You can use this tool with Office 2000 and Office 2002 (XP).
> > Configure the add in to backup each PST when the users exit to the

machine
> > with the DVD drive.
> >
> > As a side note, the reason your script isn't working is because the pst

file
> > isn't closed until after the quit event. The tool from Microsoft should
> > work better for you.
> >
> >
> > "dev_kh" <devkh@discussions.microsoft.com> wrote in message
> > news:CEE7DFE9-F693-4FEC-A0BF-E9A64B94C7B5@microsoft.com...
> > >
> > > Hi,
> > >
> > > we have a small office setup with few peer to peer linked win xp

machines.
> > Only one machine has dvd drive where daily backups occur every night.

Our
> > outlook pst files are very important and need to be backed up every

night.
> > >
> > > So I need to create a small snippet in outlook which will backup my

pst
> > file from my machine to the backup machine everytime I close outlook.

To
> > do so, I create a FileSystemObject which copies and pastes the

outlook.pst
> > file on application_quit event. My problem is that whenever it tries to
> > backup, it gives the following error:
> > >
> > > "Method 'Copy' of object 'IFile' failed."
> > >
> > > Please note, this code works fine if I try to copy and past someother

file
> > which outlook is not using, for e.g. oldOutlook.pst.
> > > My guess is that maybe the outlook.pst file is still locked which is

> > causing this error... anyway to get around it...or any other idea to

resolve
> > this issue. (please see code below)
> > >
> > > Thanks
> > > Dev
> > > ==========
> > > Private Sub Application_Quit()
> > > BackupPST
> > > End Sub
> > >
> > > Sub BackupPST()
> > > Dim objFileSystem
> > > Dim f2
> > > Dim strSource As String
> > > Dim strDestination As String
> > >
> > > strSource= "D:\Outlook\Outlook.pst"
> > > strDestination = "\\Backup\outlook\user\dev\Outlook.pst"
> > >
> > > 'Create a file system object for file handling
> > > Set objFileSystem = CreateObject("Scripting.FileSystemObject")
> > >
> > > 'Copy the outlook files to backup
> > > Set f2 = objFileSystem.getfile(strSource)
> > >
> > > 'Backup the file to the specified location
> > > f2.Copy (strDestination) 'This is where the error occurs!!!!
> > > End Sub

> >
> >
> >



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off