J
Jeff
Hi,
I'm maintaining some software for my company that calls word via the
COM. I'm using this forum as word exposes most of its VBA functions
through the COM so I still have access to the methods. If any one here
doesn't know how to help then I'm stuffed .
First I'll explain what I'm trying to do and then the problem I'm
having. My company's software allows people to create word templates
that allow merge fields to be filled from a database. When we upgraded
this software the vba code behind these templates was changed to
compensate. For our clients to upgrade we need to convert their old
templates (often in the hundreds) to new ones with the new vba code.
The way it was done was to create a blank document with the new vba
code, open the old template and copy and paste the contents. Rather
basic but it worked until now.
A client I'm trying to upgrade have used some of the more advanced
features of word like continuous sections. When these are copied they
turn into next page sections. I found Microsoft documentation say it
does this by design.
I had to bight the bullet and learn the word object model. I now have
it looping though coping section by section, restoring the section
brakes as it goes.
The problem I have is the headers and footers. The headers are blank in
some of the original documents. When copied a single paragraph mark
appears pushing out the formatting of the main body. If I open the
header view and close it without typing a thing they disappear. Same
happens if I open the print preview. I just can't get the code to do
this automatically.
I found a bug http://support.microsoft.com/default.aspx?kbid=813816 and
applied the suggested patch. It didn't help. I've been banging my head
against this for days now. Any ideas would be most welcome.
I'm maintaining some software for my company that calls word via the
COM. I'm using this forum as word exposes most of its VBA functions
through the COM so I still have access to the methods. If any one here
doesn't know how to help then I'm stuffed .
First I'll explain what I'm trying to do and then the problem I'm
having. My company's software allows people to create word templates
that allow merge fields to be filled from a database. When we upgraded
this software the vba code behind these templates was changed to
compensate. For our clients to upgrade we need to convert their old
templates (often in the hundreds) to new ones with the new vba code.
The way it was done was to create a blank document with the new vba
code, open the old template and copy and paste the contents. Rather
basic but it worked until now.
A client I'm trying to upgrade have used some of the more advanced
features of word like continuous sections. When these are copied they
turn into next page sections. I found Microsoft documentation say it
does this by design.
I had to bight the bullet and learn the word object model. I now have
it looping though coping section by section, restoring the section
brakes as it goes.
The problem I have is the headers and footers. The headers are blank in
some of the original documents. When copied a single paragraph mark
appears pushing out the formatting of the main body. If I open the
header view and close it without typing a thing they disappear. Same
happens if I open the print preview. I just can't get the code to do
this automatically.
I found a bug http://support.microsoft.com/default.aspx?kbid=813816 and
applied the suggested patch. It didn't help. I've been banging my head
against this for days now. Any ideas would be most welcome.