Expand|Select|Wrap|Line Numbers
- Private Word_App As Word.Application
- Private Word_Doc As Word.Document
- Private Word_Rtf_Doc As Word.Document
- Private Word_Table As Word.Table
- Private Word_Range As Word.Range
- Private objRow As Row
- Private objCell As Cell
- Private sCellText As String
- Private Range As Range
- Private strPath As String
- Private iMarcaPaginas As Integer
- Private iMarcaCartasIndividuais As Integer
- Private strTempLogo As String
- iMarcaPaginas = 0
- iMarcaCartasIndividuais = 1
- strPath = strCaminho
- Set Word_App = New Word.Application
- Set Word_Doc = Word_App.Documents.Add(DocumentType:=wdNewBlankDocument)
- Set Word_Range = Word_App.ActiveDocument.Range()
- Word_App.Options.CheckGrammarAsYouType = False
- Word_App.Options.CheckSpellingAsYouType = False
When The document is complete, I need to save it as a .pdf file THEN create a NEW ONE, Blank Document, to fill it again with others data but with the same functions
the method to create a blank document is inside a loop, and it's working FINE. But when it comes to create the blank document of number 407 and it tries to run this line of code, it gives me an error:
Expand|Select|Wrap|Line Numbers
- Set Word_Doc = Word_App.Documents.Add(DocumentType:=wdNewBlankDocument)
- Word_App.selection.Paste
What could it be? Why the error happens only when I try to run this in the 407th time ?