I'm getting an error whenever i had a document open and then it isn't anymore. IE.
I open an instance of word and set an object to control it..well when i close the document and look for word again i shouldn't find it so it creates another instance of it...prints out the text needed and theni have it try to extend the margins and it pops giving me the error...my code to check the word object is
Code:
Public Function prepRPT()
On Error Resume Next
    Set wordApp = GetObject(, "Word.Application")
    If Err.Number <> 0 Then Set wordApp = Nothing
    If wordApp Is Nothing Then
        Set wordApp = CreateObject("Word.Application")
    End If
    DoEvents
    If wordApp.Documents.Count = 0 Then wordApp.Documents.Add
End Function
This is the code i am using to call this check and the printouts....
Code:
        Do Until rsT.EOF
            prepRPT
            For i = colData.Count - 1 To 0 Step -1
                colData.Remove (i)
            Next i
            For f = 0 To rsT.Fields.Count - 1
                colData.Add rsT.Fields(f).Value, rsT.Fields(f).Name
            Next
            If bolLists = False Then
                printRPT colData, cmbLists.Text
            Else
                prtLists colData, cmbLists.Text
            End If
            Set colData = Nothing
            rsT.MoveNext
        Loop
        prepRPT
        wordApp.ActiveDocument.Range.Select
        wordApp.Selection.PageSetup.RightMargin = InchesToPoints(0.25)
        wordApp.Selection.PageSetup.LeftMargin = InchesToPoints(0.25)
and i have Public wordapp as word.application in a module....

thank you for the help

- nc