Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Outlook Dependancy?
#1
I copied this code from one macro to another macro and I get the below error with "Macro" but "Macro 2" works fine. it errors out on the "_getactive" line. but they are identical.

what am I missing here?

Quote:Error in Archive Item in Outlook: unknown identifier.

Macro Macro
Code:
Copy      Help
typelib Outlook {00062FFF-0000-0000-C000-000000000046} 9.4
str foldername="2013 Archive"
Outlook.Application app._getactive
;Outlook.Applicatiaon app._getactive
Outlook.MailItem msg=app.ActiveExplorer.Selection.Item(1); err 'D; ret
Outlook.MAPIFolder froot=app.GetNamespace("MAPI").Folders.Item(1)
Outlook.MAPIFolder fdest=froot.Folders.Item(foldername)


Macro Macro2
Code:
Copy      Help
typelib Outlook2 {00062FFF-0000-0000-C000-000000000046} 9.4
str foldername="Temp"
Outlook.Application app._getactive
Outlook.MailItem msg=app.ActiveExplorer.Selection.Item(1); err 'D; ret
Outlook.MAPIFolder froot=app.GetNamespace("MAPI").Folders.Item(1)
Outlook.MAPIFolder fdest=froot.Folders.Item(foldername)
An old blog on QM coding and automation.

The Macro Hook
#2
Not identical. Outlook and Outlook2.
#3
changed them both to "Outlook2" but didn't work. shouldn't it require "Outlook2.***" in both? it still runs fine on Macro 2 80(
An old blog on QM coding and automation.

The Macro Hook
#4
If something does not work after changing existing typelib name, try to restart QM.
#5
I restarted QM and ran this

but got the error
Error in Archive Item in Outlook: unknown identifier.
note: I did tighten up the "Outlook" declaration names.

Macro Archive Item in Outlook
Trigger CSAy 0x4     Help - how to add the trigger to the macro
Code:
Copy      Help
typelib Outlook {00062FFF-0000-0000-C000-000000000046} 9.4
str foldername="2013 Archive"
Outlook.Applicatiaon app._getactive
Outlook.MailItem msg=app.ActiveExplorer.Selection.Item(1); err 'D; ret
Outlook.MAPIFolder froot=app.GetNamespace("MAPI").Folders.Item(1)
Outlook.MAPIFolder fdest=froot.Folders.Item(foldername)
out fdest
An old blog on QM coding and automation.

The Macro Hook
#6
I started getting this error again and couldn't shake it loose.
so I found this post with the same error code. his problem was that Outlook and his program were executed using different user levels. I set Outlook to execute as admin and it worked right off the bat.


http://stackoverflow.com/questions/3750 ... -windows-7
An old blog on QM coding and automation.

The Macro Hook


Forum Jump:


Users browsing this thread: 1 Guest(s)