Results 1 to 1 of 1
2001-12-07, 12:28 #1
- Join Date
- Jan 2001
- Wetherby, Yorkshire, England
- Thanked 0 Times in 0 Posts
Word Macro to Fax (Word 2000/windows 2000)
I've written a macro in Word (2000) to automate fax sends (Windows2k fax) from my various Word fax templates. This is what I've written:
public sub Faxit()
Dim strNumber(2) As String
Dim strStyle(2) as String
strStyle(1) = "FaxNumber"
strStyle(2) = "FaxSubject"
dim x as Integer
Dim thisFax as New FAXCOMLib.FaxServer
Dim FaxtoSend as FAXCOMLib.FaxDoc
For x = 1 to 2
Selection.HomeKey Unit:= wdStory
Selection.Find.Style = ActiveDocument.Styles (strStyle(x))
strNumber(x) = Selection
Set FaxtoSend = thisfax.CreateDocument (thisDoc)
.FaxNumber = strNumber(1)
The problem is, it doesn't work. It won't run the thisFax.Connect line. I've inserted the HKLM entry for the modem and just the name of the modem but this is obviously wrong. If I leave the line out then the FaxtoSend.Send line doesn't work. I'm at a loss as to how to create the right object.
Any ideas out there?