A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

code for adding data file



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 3rd 10, 06:46 PM posted to microsoft.public.outlook.program_vba
joe schmo
external usenet poster
 
Posts: 8
Default code for adding data file

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.


Ads
  #2  
Old March 3rd 10, 06:54 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default code for adding data file

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" wrote in message
...
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.



  #3  
Old March 3rd 10, 08:21 PM posted to microsoft.public.outlook.program_vba
joe schmo
external usenet poster
 
Posts: 8
Default code for adding data file

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" wrote in message
...
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.



.

  #4  
Old March 3rd 10, 10:20 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default code for adding data file

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" wrote in message
...
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!


  #5  
Old March 4th 10, 12:34 AM posted to microsoft.public.outlook.program_vba
joe schmo
external usenet poster
 
Posts: 8
Default code for adding data file

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" wrote in message
...
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!


.

  #6  
Old March 4th 10, 12:39 AM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default code for adding data file

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" wrote in message
...
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.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
adding area code when synchronizing with mobile Magalena Outlook - Using Contacts 1 January 14th 10 11:40 PM
PRF file problem wiht personal folders data file password protecte Groupex1 Outlook - Installation 0 November 1st 07 09:01 PM
problem adding data file Lmos Outlook - Installation 7 October 6th 07 07:34 AM
Adding a Meeting Room Resource - Code attached callmedoug Outlook and VBA 0 December 6th 06 08:19 PM
Can't get code to put data into current folder John E. Outlook - Using Forms 3 September 16th 06 04:54 AM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.