Forecast Automation

a task was set on my lap that required me to:

  • Iterate over many (1000) message folders in Outlook 2010
  • for each folder in a specific subfolder, right-click the menu, select export in pdf format (this is the "DocumentExporter" plugin) and click ok

I rarely use appearance, so I never automated it. I see you can do this with vba as well as potentially .net (I installed .net programmable extensions)

Any suggestions on the quickest way to do this?

Thanks!

+4
source share
2 answers

I do not have Outlook here, so there is an air code.

Sub DoIt() Recurse ActiveExplorer.CurrentFolder ' select relevant folder in Outlook first End Sub Sub Recurse(f as MAPIFolder) Dim sf As MAPIFolder PrintPdf For Each sf In f.Folders ' open a potential sub-tree of folders, and move down one folder in the UI SendKeys "{RIGHT}{PAUSE 100}{DOWN}" Recurse sf Next f End Sub Sub PrintPdf() ' open the context menu, go down 4 entries, press enter, wait 10 seconds SendKeys "{APP}{PAUSE 100}{DOWN 4}{ENTER}{PAUSE 10000}" End Sub 

I don't know if this will work, it's just an idea. Make sure that Outlook is in the foreground at runtime (by assigning the DoIt() routine to the user toolbar button). The start folder must be selected before starting.

+2
source

VBA or .NET are a good choice for office automation, but .NET is a more reliable future.

If you plan to automate office bit 64 bit now or in the future, you should use .NET!

0
source

All Articles