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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Follow hyperlink and Send keys Command

Status
Not open for further replies.

mcfaddea

Technical User
Apr 7, 2003
24
GB
Hi, Hope someone can help.
I am attempting to develop a little bit of code within access in the hope that when I press the command button the code will run, access a number of web pages and print th content of those pages.

I have tried using follow hyperlink and then send keys but it appears that after sending ctrl p the web page still holds focus therefore when I send enter command it actions on the web page and not the print box.

Anybody any ideas!!

Cheers
Alan
 
On top of this I have tried
Sub ShellPrint()

Dim strPath As String
Dim strShellStatment As String
Dim dRetVal As Double

' Get the path to Internetexplorer.exe.
strPath = "C:\Program Files\Internet Explorer"

'build the first Shell function argument.
strShellStatment = strPath & "\iexplore.exe "

' Build shell to complete web page argument
strShellStatment = strShellStatment & " /p"

' Execute the Shell function.
dRetVal = Shell(strShellStatment, 1)

' If the Shell function call fails, 0 is returned.
If dRetVal = 0 Then
' The Shell function failed. Enter error-trapping code here.
MsgBox "The Shell command failed!", vbCritical
End If

End Sub


Still no joy . Someone musthave an idea
 
Surely someone has tried this before, I will have no hair left at this rate. Only other option I can think of is sending the command that would run print shortcut icon in menu-bar, but I have no idea how that could be done!!

Cheers
Alan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top