Hi all,
I have a for next loop running that has a case select section in it. If a case is found to be true the app tells an Act! database to genereate a letter using word.
I then need to print the letter. when i tell the the active document to print I get an error saying that there is no active document.
I have no idea as to why is says that there is no active document as i can see it in word.
Can anyone please help as this is making me pull my hair out.
Here is a snippet of the code:
Thanks in advance
I hope i am not being really stupid and apologise if I am.
Cheers
Techu4
I have a for next loop running that has a case select section in it. If a case is found to be true the app tells an Act! database to genereate a letter using word.
I then need to print the letter. when i tell the the active document to print I get an error saying that there is no active document.
I have no idea as to why is says that there is no active document as i can see it in word.
Can anyone please help as this is making me pull my hair out.
Here is a snippet of the code:
Code:
'This sets up the Act! database object
Set objapp = CreateObject("ACTOLE.APPOBJECT")
Set objviews = objapp.Views
Set objC = objviews.Create(1, "CL")
Dim intX As Integer
Dim WD As Object
Set WD = New Word.Application
For intX = 1 To UBound(RowData) 'Rows dimension
......other code sits here
Select Case StatUs
Case "Input", "Sales Capture", "Awaiting Refer Sales Contact", "Awaiting Sales Contact", "Awaiting Quoting"
smsMessage = "Your recent Loan Application has been provisionally approved. Call us on 08704 428030, quoting your name & postcode so your loan can be arranged."
Call SendSmS
Case "Originals Pack Sent"
smsMessage = "Your signable documents have been sent out and should be with your in 48 hours."
Call SendSmS
Case "Awaiting Docs"
smsMessage = "We have not received your loan documents back. Please complete and return A.S.A.P"
Call SendSmS
Case "Advance Pack Sent"
objapp.Command 2300
Pause 7500 'sleep for 2.5 seconds
On Error GoTo ActiveDoC
WD.ActiveDocument.PrintOut
Pause 5000 'sleep for 2.5 seconds
WD.Application.Quit wdDoNotSaveChanges
Pause 2500
End Select
......other code sits here
Next intX
Set WD = Nothing
Thanks in advance
I hope i am not being really stupid and apologise if I am.
Cheers
Techu4