Opening Merge Document tries to remerge the document 
Author Message
 Opening Merge Document tries to remerge the document

I have a macro in Word 97 that is called from a vb6 program.  The vb6
program creates the data files (3 different comma dilimited text) then
calls the macro.  The macro reads each of these 3 files 1 at a time
and creates several small documents.  The documents are then all
placed into 1 big document (the end result).

The problem comes when I try to save the document then reopen it.  If
I step through the macro I can see the document looks fine (all page
breaks in the correct places borders, graphics/logos in the right
place) before I save it.  When I save close and reopen (see code
below) it looks terrible.  The page breakes are gone, images are the
wrong size etc...  What makes me think it is trying to remerge the
document is the when you look at the page special characters we use
the delete from the document are back.  Almost like it is linking the
file instead of saving the new final document.

This macro was origionally created in wordbasic and is now being
converted to vba.  I left the wordbasic code in to see if anybody
knows if I am converting it wrong.

'WordBasic.FileSave
ActiveDocument.Save

    'Sets Recent File List to 1 so User does not see list of temp
files

'WordBasic.ToolsOptionsGeneral RecentFileCount:=1
Application.RecentFiles.Maximum = 1

    'Sets Recent File List to default of 4, does not reshow temp files

'WordBasic.ToolsOptionsGeneral RecentFileCount:=4
Application.RecentFiles.Maximum = 4

'By closing the document file and then reopen it we are able to
'delete the temporary files after this section

'WordBasic.FileClose 2
ActiveDocument.Close savechanges:=wdDoNotSaveChanges

'WordBasic.FileOpen Name:=DocName$
Documents.Open FileName:=DocName$

ActiveWindow.View = wdPageView

Any help would be greatly appriciated.

mb.



Mon, 21 Jun 2004 05:52:36 GMT  
 Opening Merge Document tries to remerge the document
Hi Mike,

Quote:
> The problem comes when I try to save the document then reopen it.  If
> I step through the macro I can see the document looks fine (all page
> breaks in the correct places borders, graphics/logos in the right
> place) before I save it.  When I save close and reopen (see code
> below) it looks terrible.

Is it possible that you're not saving it as a "Word Document", but in a
different file format, such as RTF or Word6/95? Step through the code,
and at the FileSave part, before it executes, check the File/Save As
dialog box. What file format is shown at the bottom?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)



Mon, 21 Jun 2004 21:57:03 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Trouble Opening a Word Document with VB.NET,Open member not found in Documents

2. (Q211727) Mail merge document restored to normal document - Word 2000

3. Trying to append a simple XML document as a node in an XML document

4. Removing mail merge data source when opening a document

5. Opening a Mail merged Document from word

6. Catch-22 when trying to obtain properties of an open Office document

7. Document Statistics Without Opening a Document

8. Mail merge from Access try to open an already open DB

9. Opening and updating Office 2000 documents in an open event macro

10. Opening new document without a new window opening

11. How can I open a web browser with an open document

12. e-mail from Access via does not send merged Word document

 

 
Powered by phpBB® Forum Software