I have some code that was written for Excel 7.0 and Word 7.0 but now we use Office 97.
I haven't had to modify any of the code as it appears to work fine however when in Word the cursor doesn't move to the designated bookmarks when required and when printing the Word document I have all the indications of the document printing but nothing comes out of the printer!!!
The code follows:
If Selection.Rows.Count <> 1 Or Selection.Columns.Count <> 256 Then
MsgBox "You have not made a valid selection! Please select the row " _
+ "which contains the data for the invoice you want to print." _
, 48, "Invalid Selection"
Set Word7 = CreateObject("Word.Basic")
RowRef = Selection.Row
RFI$ = Cells(RowRef, 1)
RFIDate$ = Cells(RowRef, 2)
Answer = .MsgBox("Are you sure you want to print the invoice?", _
"Print Invoice", 36)
If Answer = -1 Then
.ToolsOptionsPrint , , 1
.FilePrint , , , , , , , , , 2
If .CountWindows() = 0 Then .AppClose
Set Word7 = Nothing
AppActivate "Microsoft Excel"