|
-
Nov 13th, 2000, 01:12 PM
#1
Thread Starter
New Member
Seems simple enough...populate listbox w/ filenames, set new object to Word.Application, open file, save as RTF, save as HTML, close document, move to next.
The problem seems to be that each time it is sucking up a bit of memory it is not releasing and eventually it grinds to a halt when doing 2000 or so docs (121mb; makes it to around 1500 docs). Word 2000 being used.
Any ideas? Below is general code used:
Private Sub ConvertToRTFandHTM()
Dim wrdConverter As FileConverter
Dim wordAppRTF As Word.Application
Set wordAppRTF = New Word.Application
Dim bFoundConverter As Boolean
On Error Resume Next
wordAppRTF.Visible = False
If List1.ListCount > 0 Then
For n = 0 To (List1.ListCount - 1)
wordAppRTF.Documents.Open FileName:=List1.List(n)
wordAppRTF.DefaultSaveFormat = "Rtf"
wordAppRTF.ActiveDocument.SaveAs "TEMP.RTF", FileFormat:=wdFormatRTF
For Each wrdConverter In wordAppRTF.FileConverters
If wrdConverter.ClassName = "HTML" Then
bFoundConverter = True
Exit For
Else
bFoundConverter = False
End If
Next wrdConverter
If bFoundConverter = True Then
wordAppRTF.ActiveDocument.SaveAs FileName:="TEMP.HTM", FileFormat:=wrdConverter.SaveFormat
Else
wordAppRTF.ActiveDocument.SaveAs FileName:="TEMP.HTM", FileFormat:=wdFormatHTML
End If
wordAppRTF.ActiveDocument.Close
Set wrdConverter = Nothing
Set TempDir = Nothing
Set TempFile = Nothing
Next
End If
wordAppRTF.Quit
Set wordAppRTF = Nothing
On Error GoTo 0 'Turn off error handler
End Sub
-
Nov 13th, 2000, 01:59 PM
#2
Hyperactive Member
Whoa!
To me, it looks like you cache is too small to handle all those docs at one time. How much memory do you have on the pc where you are running the app? In other words, does the computer you are running the application on have 128 MB or more of RAM memory? Oh, by the way, are you getting an error or is it just plain freezing up?
-vbuser1976 
VB6 Enterprise SP6
SQL 7.0 SP2
VBScript, HTML, Javascript, C++, a little UNIX
-
Nov 13th, 2000, 02:06 PM
#3
Thread Starter
New Member
Word.object sucking up memory
Machine has 128+ RAM; whole machine doesn't die, nor does VB app produce error. The app just sits there doing nothing until ya kill it with task manager.
kinda bogus.
I was kinda thinking that once the activedocument.close happens, the document ain't taking up any more space (memory-wise); does Word not release it?
I've tried moving the document.open, wordapp.quit, and set new wordapp stuff around so that it happens
1. Only once for all files
2. once for every file, setting to nothing at end of for...next
Either way, it just keeps slowing eating up the space.
-
Nov 13th, 2000, 02:13 PM
#4
Hyperactive Member
Hmm...
I have realized that this new Office 2000 has a tendency to be memory hogs. Because of the new updates and such. From what I get from you, can't you run the app in two sections, i.e. running the same procedure twice? Take the first half of docs , process them, then take the second half and do those. It's just an idea but why don't you try it?
-vbuser1976 
VB6 Enterprise SP6
SQL 7.0 SP2
VBScript, HTML, Javascript, C++, a little UNIX
-
Nov 14th, 2000, 08:35 PM
#5
New Member
I've got the same problem using VB5 / Word 97, see:
http://forums.vb-world.net/showthrea...threadid=40059
Have you got a solution yet?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|