code for adding data file

Status
Not open for further replies.
J

joe schmo

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.
 
K

Ken Slovak - [MVP - Outlook]

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"

"joe schmo" <joeschmo> wrote in message

news:3238EF4D-9AB9-4A27-A206-75A473CCED21@microsoft.com...
> 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.

>
 
J

joe schmo

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!
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"

> >

>

> "joe schmo" <joeschmo> wrote in message
> news:3238EF4D-9AB9-4A27-A206-75A473CCED21@microsoft.com...
> >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.
> >


> .
>
 
K

Ken Slovak - [MVP - Outlook]

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.

"joe schmo" <joeschmo> wrote in message

news:9C5046CF-4FC2-4F15-A24F-F6CE30A7CBEF@microsoft.com...
> 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!
 
J

joe schmo

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.
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.

> >

>

> "joe schmo" <joeschmo> wrote in message
> news:9C5046CF-4FC2-4F15-A24F-F6CE30A7CBEF@microsoft.com...
> > 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!


> .
>
 
K

Ken Slovak - [MVP - Outlook]

You got my strongest possible recommendation. What you do after is up to you

<shrug

"joe schmo" <joeschmo> wrote in message

news:3B9E092C-FF77-49C1-AF23-B8DB06BFE992@microsoft.com...
> 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.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Z Outlook Custom Form: Adding Dropdown(Project Code) at the end of subject Outlook VBA and Custom Forms 0
Aussie Outlook 365 Rule runs manually but returns the error code "an unexpected error has occurred" when incoming mail arrives Using Outlook 1
S Need code to allow defined starting folder and selection from there to drill down Outlook VBA and Custom Forms 10
D VBA code to select a signature from the signatures list Outlook VBA and Custom Forms 3
S HTML Code Embedded in String Within Open Outlook Email Preventing Replace(Application.ActiveInspector.CurrentItem.HTMLBody From Working Outlook VBA and Custom Forms 4
P Color Code or highlight folders in Outlook 2016 Using Outlook 2
N Please advise code received new mail Using Outlook 0
B Outlook 2016 Unable to view images or logos on the outlook 2016 emails the same html code works well when i use outlook 2010 Using Outlook 0
S Excel vba code to manage outlook web app Using Outlook 10
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
S Add VBA save code Using Outlook 0
C Auto Run VBA Code on new email Outlook VBA and Custom Forms 1
witzker Pls help to change the code for inserting date in Ol contact body Outlook VBA and Custom Forms 5
I Outlook 2003 shows html code when To: field is empty Using Outlook 7
F VBA code to dock Styles whenever I write or edit an email Outlook VBA and Custom Forms 0
S Skype for business meeting vba code Outlook VBA and Custom Forms 1
R Expand VBA Permanent Delete Code Outlook VBA and Custom Forms 6
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
A VBA Code in Outlook disappears after first use Outlook VBA and Custom Forms 1
Alex Cotton "invalid or unqualified reference" on code that should work Outlook VBA and Custom Forms 5
F VBA to ensure a code is entered in Subject title Outlook VBA and Custom Forms 1
D Any updates or fixes that would make this code stop working just moving emails to another folder Outlook VBA and Custom Forms 1
N Open & Save VBAProject.Otm using VBA Code Outlook VBA and Custom Forms 1
M error code 0x8DE00006 Using Outlook 1
R VBA Code to permanently delete selected email Outlook VBA and Custom Forms 10
dyny723 Outlook 2016: Code to link a contact to emails received from that contact Outlook VBA and Custom Forms 1
D Command Button code will not execute. Any suggestions Please. Outlook VBA and Custom Forms 2
V VB script code to save a specific email attachment from a given email Outlook VBA and Custom Forms 14
J Custom form code doesn't run Outlook VBA and Custom Forms 2
M code to move selected Outlook contacts to another folder Using Outlook 3
E Outlook Form - Voting Responses Not Auto Processing If Form Contains Any Code Outlook VBA and Custom Forms 0
C Need VBA code to automatically save message outside outlook and add date Outlook VBA and Custom Forms 1
S Problem running Command button code Outlook VBA and Custom Forms 2
D Help with code to move mail on receipt to another folder based on time received Outlook VBA and Custom Forms 2
C Color Code New Calendar Items Using Outlook 2
S VBA Code to move mail items from search folder to inbox subfolder Outlook VBA and Custom Forms 4
B Automation error running VB macro code Outlook VBA and Custom Forms 8
S my vbscript button1_click code works on appointment created but not on opening an existing apntmn Outlook VBA and Custom Forms 16
M regarding the Create Contacts From Messages code Using Outlook 8
J Outlook 2010 VBScript editor does not run code at all Outlook VBA and Custom Forms 0
B VBA Code to create appointment from email Outlook VBA and Custom Forms 1
D VBA Code to strip Subject Line when replying or forwarding Using Outlook 3
L Outlook 2007 Contact Form Code Not Working Using Outlook 20
S The attempted operation failed ... 2nd time running code Outlook VBA and Custom Forms 3
A Check for attachment code not working Outlook VBA and Custom Forms 1
A Code to automatically delete message after sending Outlook VBA and Custom Forms 6
T What code to use to move the custom field values to message body when sending e-mail ? Outlook VBA and Custom Forms 8
G Annoying page of code when receiving Using Outlook 14
M VBA Code to Restart Outlook on error Outlook VBA and Custom Forms 3
Z Default VBA code for extracting data from email (Outlook) to Excel? Outlook VBA and Custom Forms 1

Similar threads

Top