E
expect_ed
Created a set of Macros to file messages, then drive them with ALT keys from
toolbar buttons, each button with it's own code. I'm trying to distribute
this to co-workers, so I put the code into a word file and give instructions
on how to add a new module in Outlook and copy this code:
Sub Move2XL_GPointr()
Dim xl As Excel.Application
Dim TopFldr As String
Dim TargetFldr As String
Set xl = GetObject(, "Excel.Application")
TopFldr = xl.Workbooks("Index.xls").Sheets(1).Range("TopFldrG").Value
TargetFldr = xl.Workbooks("Index.xls").Sheets(1).Range("TrgtFldrG").Value
'Move current item to designated folder
Dim msg As Object
For Each msg In ActiveExplorer.Selection
msg.Move _
GetNamespace("MAPI").Folders(TopFldr).Folders(TargetFldr)
Next 'msg
Set msg = Nothing
End Sub
I have them open Reference and turn on the Excel Object Library. When they
try to run the macro from ALT-F8 menu they get a Runtime Error 9 - Script Out
of Range. Googling found an issue in Excel with manual copying of VBA
modules but I can't quite grasp the issue or be certain it is similar to my
problem.
Any help apprected.
TIA
ed
toolbar buttons, each button with it's own code. I'm trying to distribute
this to co-workers, so I put the code into a word file and give instructions
on how to add a new module in Outlook and copy this code:
Sub Move2XL_GPointr()
Dim xl As Excel.Application
Dim TopFldr As String
Dim TargetFldr As String
Set xl = GetObject(, "Excel.Application")
TopFldr = xl.Workbooks("Index.xls").Sheets(1).Range("TopFldrG").Value
TargetFldr = xl.Workbooks("Index.xls").Sheets(1).Range("TrgtFldrG").Value
'Move current item to designated folder
Dim msg As Object
For Each msg In ActiveExplorer.Selection
msg.Move _
GetNamespace("MAPI").Folders(TopFldr).Folders(TargetFldr)
Next 'msg
Set msg = Nothing
End Sub
I have them open Reference and turn on the Excel Object Library. When they
try to run the macro from ALT-F8 menu they get a Runtime Error 9 - Script Out
of Range. Googling found an issue in Excel with manual copying of VBA
modules but I can't quite grasp the issue or be certain it is similar to my
problem.
Any help apprected.
TIA
ed