PC Review


Reply
Thread Tools Rate Thread

code for adding data file

 
 
joe schmo
Guest
Posts: n/a
 
      3rd Mar 2010
I would like to make a macro that would add a data file. Is this possible?
Lets say the file name is archive.pst located in G:\temp. thanks very much

I want to do this because I want the user to be able to access the data
files while at work (data files on server), and not get the 'cannot access
data file' error when she goes home and opens outlook.


 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      3rd Mar 2010
You do know that storing and using PST files stored anywhere but on a local
hard drive is not supported, may lead to problems and data corruption and
loss or locking or corruption of the PST and that no one will support you if
things go wrong, correct?

If a PST file is opened in Outlook and the user then goes to where that file
is not accessible what makes you think they will be able to use the file
then? Outlook will just show an error that it cannot load the file.

The code itself is simple, assuming you are using an Outlook version that
supports this, you never mentioned your version:

Application.Session.AddStore "G:\temp\archive.pst"

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"joe schmo" <(E-Mail Removed)> wrote in message
news:3238EF4D-9AB9-4A27-A206-(E-Mail Removed)...
>I would like to make a macro that would add a data file. Is this possible?
> Lets say the file name is archive.pst located in G:\temp. thanks very
> much
>
> I want to do this because I want the user to be able to access the data
> files while at work (data files on server), and not get the 'cannot access
> data file' error when she goes home and opens outlook.
>
>


 
Reply With Quote
 
joe schmo
Guest
Posts: n/a
 
      3rd Mar 2010
Actually we all have archive pst files on a server. This is to reduce the
working copy in exchange. we are using outlook 2003 and 07. I just want
the user to not see the archives when she goes home with laptop, and then see
them when she comes into work (server accessible). I'm pretty sure this is
supported though....standard procedure no?

otherwise, I'll work with your code, thanks!

"Ken Slovak - [MVP - Outlook]" wrote:

> You do know that storing and using PST files stored anywhere but on a local
> hard drive is not supported, may lead to problems and data corruption and
> loss or locking or corruption of the PST and that no one will support you if
> things go wrong, correct?
>
> If a PST file is opened in Outlook and the user then goes to where that file
> is not accessible what makes you think they will be able to use the file
> then? Outlook will just show an error that it cannot load the file.
>
> The code itself is simple, assuming you are using an Outlook version that
> supports this, you never mentioned your version:
>
> Application.Session.AddStore "G:\temp\archive.pst"
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "joe schmo" <(E-Mail Removed)> wrote in message
> news:3238EF4D-9AB9-4A27-A206-(E-Mail Removed)...
> >I would like to make a macro that would add a data file. Is this possible?
> > Lets say the file name is archive.pst located in G:\temp. thanks very
> > much
> >
> > I want to do this because I want the user to be able to access the data
> > files while at work (data files on server), and not get the 'cannot access
> > data file' error when she goes home and opens outlook.
> >
> >

>
> .
>

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      3rd Mar 2010
No, it's absolutely not supported at all. PST files anywhere other than on a
local hard drive are totally unsupported. I would strongly recommend against
what you plan and how you store the archive PST's.

If you add a PST file, either in the UI or in code, it will be there in
Outlook and show up until Outlook is closed. If it was removed prior to
closing Outlook it won't show up or fire errors starting Outlook if the PST
isn't available. If it is not removed prior to shutdown there will be errors
if the PST is not available.

There is a RemoveStore() method that takes a file path, but the user would
have to run that code before shutting down Outlook.

If something in this causes corruption, data loss or the inability to open
the PST file don't be surprised and don't expect anyone to help you. Expect
any MVP to tell you that what you did was unsupported. If you still want to
do this you're on your own.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"joe schmo" <(E-Mail Removed)> wrote in message
news:9C5046CF-4FC2-4F15-A24F-(E-Mail Removed)...
> Actually we all have archive pst files on a server. This is to reduce the
> working copy in exchange. we are using outlook 2003 and 07. I just want
> the user to not see the archives when she goes home with laptop, and then
> see
> them when she comes into work (server accessible). I'm pretty sure this
> is
> supported though....standard procedure no?
>
> otherwise, I'll work with your code, thanks!


 
Reply With Quote
 
joe schmo
Guest
Posts: n/a
 
      3rd Mar 2010
thanks for the reply. Seems like I got you on a bad day though. Please
understand that your role is to advise and recommend, not to accuse and
berate. Hope tomorrow is a better day for you.
till next time.

"Ken Slovak - [MVP - Outlook]" wrote:

> No, it's absolutely not supported at all. PST files anywhere other than on a
> local hard drive are totally unsupported. I would strongly recommend against
> what you plan and how you store the archive PST's.
>
> If you add a PST file, either in the UI or in code, it will be there in
> Outlook and show up until Outlook is closed. If it was removed prior to
> closing Outlook it won't show up or fire errors starting Outlook if the PST
> isn't available. If it is not removed prior to shutdown there will be errors
> if the PST is not available.
>
> There is a RemoveStore() method that takes a file path, but the user would
> have to run that code before shutting down Outlook.
>
> If something in this causes corruption, data loss or the inability to open
> the PST file don't be surprised and don't expect anyone to help you. Expect
> any MVP to tell you that what you did was unsupported. If you still want to
> do this you're on your own.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "joe schmo" <(E-Mail Removed)> wrote in message
> news:9C5046CF-4FC2-4F15-A24F-(E-Mail Removed)...
> > Actually we all have archive pst files on a server. This is to reduce the
> > working copy in exchange. we are using outlook 2003 and 07. I just want
> > the user to not see the archives when she goes home with laptop, and then
> > see
> > them when she comes into work (server accessible). I'm pretty sure this
> > is
> > supported though....standard procedure no?
> >
> > otherwise, I'll work with your code, thanks!

>
> .
>

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      3rd Mar 2010
You got my strongest possible recommendation. What you do after is up to you
<shrug>

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"joe schmo" <(E-Mail Removed)> wrote in message
news:3B9E092C-FF77-49C1-AF23-(E-Mail Removed)...
> thanks for the reply. Seems like I got you on a bad day though. Please
> understand that your role is to advise and recommend, not to accuse and
> berate. Hope tomorrow is a better day for you.
> till next time.


 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating excel file, adding code to it from code, VBE window stays BlueWolverine Microsoft Excel Programming 0 5th Nov 2009 07:55 PM
Adding Project file to existing web code John A. Bailo Microsoft Dot NET 0 9th Oct 2007 05:55 PM
Adding data from code turns into geometric progression =?Utf-8?B?QnJ1Y2U=?= Microsoft Access VBA Modules 2 19th Jun 2007 03:34 PM
Sample code to make your code reload data that changed in config file delphiconsultingguy@yahoo.com Microsoft Dot NET Framework 0 13th Jun 2006 06:55 PM
Adding native code to .Net-file =?ISO-8859-1?Q?Daniel_D=FCnker?= Microsoft Dot NET 7 18th Jan 2006 09:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:11 PM.