Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to get a Simple ( I hope) outlook Macro to work

Status
Not open for further replies.

ex0r

IS-IT--Management
Apr 13, 2004
6
US
What I'm trying to get this thing to do is to put in the keys to manually Import an Excel file into the task list. It would probably be better to do this without using SendKey but that's the only way I know of. I've never used VBA before :( Any help would be much appreciated. Here's what I have so far.


Public Sub Macro1()

SendKeys "%F", True
pausetime = 2
SendKeys "{T}", True
pausetime = 2
SendKeys "{TAB}", True
pausetime = 2
SendKeys "{ENTER}", True
pausetime = 2
SendKeys "{DOWN 6}", True
pausetime = 2
SendKeys "{TAB 2}", True
pausetime = 2
SendKeys "{ENTER}", True
pausetime = 2
SendKeys "{TAB 2}", True
pausetime = 2
SendKeys "{UP}", True
pausetime = 2
SendKeys "{TAB 2}", True
pausetime = 2
SendKeys "{ENTER}", True
pausetime = 2
SendKeys "{TAB 2}", True
pausetime = 2
SendKeys "{ENTER}", True
pausetime = 2
SendKeys "{TAB 4}", True
pausetime = 2
SendKeys "{ENTER}", True
pausetime = 300
objThisOutlookSession.InvokeDialog
End Sub


But the thing stops working as soon as it gets to the Import window, I think I have to insert some kind of change focus command in there somewhere. Thanks in Advance!

-Matt
 
Err sorry, ignore the last part, I was just trying something out without actually knowing what I was doing :/ Also, forgot to add that I want it to repeat itself every 5 minutes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top