Jump to content

Recommended Posts

Posted

is there any easy way to search a users share drive(p:) for .pst and automatically add them to outlook

I have a very complicated script to do this using windows gui functions... but this requires around 200 lines of code..

???

Thanks for any help....

Posted

Are you looking for help on the "searching for .pst" part or the adding to Outlook part?

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Posted (edited)

need an easy way for both parts.... now im excited because it sounds like you have an answer!!

Hmmm... well it is a SMOC (simple matter of coding).

AutoIt has a group of functions for finding files and parsing file-specs. You'll lind lots of examples of doing similar things by searching the forums.

Outlook has a COM programming interface that would allow you to do just about anything... I've not done this, but I believe that the syntax for adding a new PST file to Outlook would be:

$oOutlook = ObjCreate("Outlook.Application")
$oNameSpace = $oOutlook.GetNamespace("MAPI")
$oNameSpace.AddStore "your-file.pst"
$oNameSpace = ""
$oOutlook = ""

Dale

Edit: you'll need the AutoIt beta to get COM support

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Posted

...around 200 lines of code...

Get a list of all PST file on that share drive:
RunWait(@ComSpec & " /c " & 'dir p:\*.pst /b /s > c:\temp\file1.txt', "", @SW_HIDE)

You can read that entire file into one variable:

(See help file sample for FileRead for a few extra lines of code if you want to be safe.)

$file1txt = FileRead("c:\temp\file1.txt", FileGetSize("c:\temp\file1.txt"))

You can turn $file1txt into an array:

$file1txtARRAY = StringSplit($file1txt, @CRLF, 1)

Then use something like this:

For $i = 1 To $file1txtARRAY[0]
   ;activate Outlook window
   ;send alt-fof
   ;wait for window "Open Outlook Data File"
   ;send info in $file1txtARRAY[$i] and enter
Next

......hope this helps.......

[size="1"][font="Arial"].[u].[/u][/font][/size]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...