Prev Previous Post   Next Post Next
  #1   Report Post  
Pat
 
Posts: n/a
Default Phone Dialer

The following code to phone an number via the dialer is not working
correctly:

Private Sub CommandButton1_Click()
'Sub CellToDialer() 'John Walkenbach
' Transfers active cell contents to Dialer
' And then dials the phone
' Modified by Jim Cone on Jan 18, 2002


Dim CellContents As String 'JBC
Dim AppName As String 'JBC
Dim AppFile As String 'JBC
Dim TaskID As Variant 'JBC


' Get the phone number
CellContents = ActiveCell.Value
If CellContents = "" Then
MsgBox "Select a cell that contains a phone number.", _
vbInformation 'JBC
Exit Sub
End If
' Activate (or start) Dialer
AppName = "C:\Windows\ServicePackFiles\i386"
'AppName = "Dialer"
' USE THE FULL FILE PATH APPLICABLE TO YOUR OPERATING SYSTEM 'JBC


AppFile = "C:\Program Files\Windows NT\dialer.exe" 'JBC
On Error Resume Next
' This activates the dialer if it showing on the desktop 'JBC
AppActivate (AppName)
If Err.Number < 0 Then
Err = 0
' This activates the dialer by opening(running) the file 'JBC
TaskID = Shell(AppFile, vbNormalFocus)
If Err < 0 Then
MsgBox "Can't start " & AppFile, vbExclamation 'JBC
Exit Sub 'JBC
End If 'JBC
End If

' Transfer cell contents to Dialer
Application.SendKeys "%n" & CellContents, True


' Click Dial button
Application.SendKeys "%d"
' Application.SendKeys "{TAB}~", True


' Selects the next telephone number in the column. 'JBC
ActiveCell(2, 1).Select 'JBC
' The macro button must now be clicked twice to dial the next 'JBC
' number in the column.
End Sub

I have entered the AppName = "C:\Windows\ServicePackFiles\i386" as the full
path name is this correct? I am using Office 2003 running on Windows

The Phone Dialer window opens but the number does not dial. I have made a
phone call directly in Phone Dialer without difficulty.

Another thing that puzzles me is when an number is highlighted in excel and
the code is run a copy of the phone number is entered into the cell
immediately below.


Anyone know what is happening here?
Thanks
Pat


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
symbols for phone, fax, email Bomar Excel Discussion (Misc queries) 1 December 8th 04 02:40 AM


All times are GMT +1. The time now is 05:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"