K
kayrogage
I have an XML document that I am looping through to generate a word
document. I loop through each element in the xml document and type it
out in the word document, as I type out each element of text I apply
the relevant style to it like so:
With m_objselection
.Style = strFormat
.TypeText(strText)
End With
m_objselection is my current selection and strFormat is the name of the
style I want to apply.
This is a very slow process, when I watch the Winword.exe process in
the task manager the memory usage just goes up and up till it runs out
of memory and can't complete the document.
If I remove the bit where I set the style the compiler whizzes through
and converts the document in no time at all, e.g.:
With m_objselection
' .Style = strFormat
.TypeText(strText)
End With
Is there some way of freeing up the memory word is using to apply each
style and speed up the process?
Thanks
Kay
document. I loop through each element in the xml document and type it
out in the word document, as I type out each element of text I apply
the relevant style to it like so:
With m_objselection
.Style = strFormat
.TypeText(strText)
End With
m_objselection is my current selection and strFormat is the name of the
style I want to apply.
This is a very slow process, when I watch the Winword.exe process in
the task manager the memory usage just goes up and up till it runs out
of memory and can't complete the document.
If I remove the bit where I set the style the compiler whizzes through
and converts the document in no time at all, e.g.:
With m_objselection
' .Style = strFormat
.TypeText(strText)
End With
Is there some way of freeing up the memory word is using to apply each
style and speed up the process?
Thanks
Kay