D
Doug Sanders
Pardon me if I'm in the wrong group, please redirect me if so. I don't want
to cross post.
I'm trying to use code to copy a word document into text for importing into
Access. Running Access '97 and Word '97 at the client's location.
Code looks like this.
Dim MyAppID As String
MyAppID = Shell("WINWORD.EXE", vbNormalFocus) ' Run Microsoft Word.
AppActivate ("Microsoft Word")
SendKeys "%(f)" 'Open 'file function
SendKeys "o"
SendKeys "Iword.doc"
SendKeys "%(o)"
SendKeys "%(f)"
SendKeys "%(a)"
SendKeys "{TAB}"
SendKeys "{DOWN}"
SendKeys "{DOWN}"
SendKeys "{DOWN}"
SendKeys "s"
SendKeys "y"
SendKeys "y"
SendKeys "%(f)" 'Open 'file function
SendKeys "x"
SendKeys "%{F4}", True
It launches Word steps thru all the line doing nothing I can see and then at
the end closes Access, not Word.
It looks like the 'SendKeys' commands are being sent to Access, not Word.
I tried the example supplied in the help file, and it does the same thing.
Sample is:
ReturnValue = Shell("CALC.EXE", 1) ' Run Calculator.
AppActivate ReturnValue ' Activate the Calculator.
For I = 1 To 100 ' Set up counting loop.
SendKeys I & "{+}", True ' Send keystrokes to Calculator
Next I ' to add each value of I.
SendKeys "=", True ' Get grand total.
SendKeys "%{F4}", True
What am I missing?
Thanks,
Doug Sanders
to cross post.
I'm trying to use code to copy a word document into text for importing into
Access. Running Access '97 and Word '97 at the client's location.
Code looks like this.
Dim MyAppID As String
MyAppID = Shell("WINWORD.EXE", vbNormalFocus) ' Run Microsoft Word.
AppActivate ("Microsoft Word")
SendKeys "%(f)" 'Open 'file function
SendKeys "o"
SendKeys "Iword.doc"
SendKeys "%(o)"
SendKeys "%(f)"
SendKeys "%(a)"
SendKeys "{TAB}"
SendKeys "{DOWN}"
SendKeys "{DOWN}"
SendKeys "{DOWN}"
SendKeys "s"
SendKeys "y"
SendKeys "y"
SendKeys "%(f)" 'Open 'file function
SendKeys "x"
SendKeys "%{F4}", True
It launches Word steps thru all the line doing nothing I can see and then at
the end closes Access, not Word.
It looks like the 'SendKeys' commands are being sent to Access, not Word.
I tried the example supplied in the help file, and it does the same thing.
Sample is:
ReturnValue = Shell("CALC.EXE", 1) ' Run Calculator.
AppActivate ReturnValue ' Activate the Calculator.
For I = 1 To 100 ' Set up counting loop.
SendKeys I & "{+}", True ' Send keystrokes to Calculator
Next I ' to add each value of I.
SendKeys "=", True ' Get grand total.
SendKeys "%{F4}", True
What am I missing?
Thanks,
Doug Sanders