Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2006

Tip: Looking for answers? Try searching our database.

Comment text highlighting lost after merge

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Smhall - 14 Aug 2006 20:52 GMT
I have a user form that merges with with an Access database.  I am using the
"PreserveFormFieldsAfterMerge" macro I found on this site.  After the merge,
the comments from the original form are still there, but the text they are
attached to is no longer highlighted (the comment field code is highlighted,
but not the text).  Is there anything I can do to fix this?
Doug Robbins - Word MVP - 14 Aug 2006 22:28 GMT
Not without some additional vba coding.  Are you creating multiple documents
at the one time with the data from the database or is it only one document
that is being created at a time?

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have a user form that merges with with an Access database.  I am using
>the
[quoted text clipped - 4 lines]
> highlighted,
> but not the text).  Is there anything I can do to fix this?
Smhall - 14 Aug 2006 22:45 GMT
The merge creates one document, then I use a "splitter" macro to save into
individual files.  The problem seems to happen after the initial merge,
because the resulting document has the highlighting problem as well.  BTW, I
am using Word 2000.

> Not without some additional vba coding.  Are you creating multiple documents
> at the one time with the data from the database or is it only one document
[quoted text clipped - 8 lines]
> > highlighted,
> > but not the text).  Is there anything I can do to fix this?
Doug Robbins - Word MVP - 15 Aug 2006 17:32 GMT
If you are saying that the highlighting is not present in the document
created when you execute the merge, then I think that you are going to have
to "roll your own" method of transferring the data into the document.

I would do it by replacing the mergefields in the main document with
DOCVARIABLE fields and then use code to iterate through the database,
setting variables in the document to the values of the fields in the active
record, updating the fields in the document so that the data is displayed in
the DOCVARIABLE fields and then saving the document with a name (probably
taken from the database) before repeating the process.

The code would be something like

'allocate memory for the database object as a whole and for the active
record

Dim myDataBase As Database

Dim myActiveRecord As Recordset

'Open a database

Set myDataBase = OpenDatabase("E:\Access97\Ely\ResidencesXP.mdb")

'Access the first record from a particular table

Set myActiveRecord = myDataBase.OpenRecordset("Owners", dbOpenForwardOnly)

'Loop through all the records in the table until the end-of-file marker is
reached

Do While Not myActiveRecord.EOF

   With ActiveDocument

       .Variables("varname").Value =
myActiveRecord.Fields("correspondingfieldname")

       'Repeat for each field

       .Fields.Update

       .SaveAs "Path\Filename"

   End With

    'access the next record

   myActiveRecord.MoveNext

Loop

'Then close the database

myActiveRecord.Close

myDataBase.Close

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> The merge creates one document, then I use a "splitter" macro to save into
> individual files.  The problem seems to happen after the initial merge,
[quoted text clipped - 17 lines]
>> > highlighted,
>> > but not the text).  Is there anything I can do to fix this?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.