Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have written some VBA code (from Access) which compiles a document based on several other documents and puts it into a new document that is macro enabled. Then, when the user opens the new document they are able to open an underlying word form and enter in some final information which is repeated throughout the document, thereby saving them time in entering those fields. These are docVariable fields which I have placed into the document through the VBA code. When they are finished filling out the form, they click a button and all the fields (the docVariables) in the document are updated. They may need to do this several times, editing their answers and re-updating. Everything works beautifully EXCEPT some fields are BOLD and some are not! I have looked everywhere in every forum and can't find anything about this. Why is this happening? How can I ensure, through VBA, that the DocVariable fields will not suddenly be bold, but will remain the same format as the surrounding text? PLEASE HELP ME!
|
#2
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
To force DOCVARIABLE fields to make use of the formatting applied at the
insertion point, add the \* CHARFORMAT switch to the field code. (Strictly speaking, the \* CHARFORMAT field uses the formatting applied to the first letter of the field code.) -- Stefan Blom Microsoft Word MVP "Terrycoco" wrote in message ... I have written some VBA code (from Access) which compiles a document based on several other documents and puts it into a new document that is macro enabled. Then, when the user opens the new document they are able to open an underlying word form and enter in some final information which is repeated throughout the document, thereby saving them time in entering those fields. These are docVariable fields which I have placed into the document through the VBA code. When they are finished filling out the form, they click a button and all the fields (the docVariables) in the document are updated. They may need to do this several times, editing their answers and re-updating. Everything works beautifully EXCEPT some fields are BOLD and some are not! I have looked everywhere in every forum and can't find anything about this. Why is this happening? How can I ensure, through VBA, that the DocVariable fields will not suddenly be bold, but will remain the same format as the surrounding text? PLEASE HELP ME! -- Terrycoco |
#3
![]() |
|||
|
|||
![]()
For anyone who also had problems with this,here's the answer I found (after MUCH time spent hunting!) Turns out there is a switch set in VBA "preserve formatting", you want it set to FALSE. Otherwise, whatever field is first in your document will force all subsequent fields to be formatting just like it! The first field in my doc was bold, therefore ALL of them turned out bold.
|
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
TOC heading 1 text bold, dot leaders and page number NOT bold | Microsoft Word Help | |||
When I apply bold to a word the whole document goes bold - ? | Microsoft Word Help | |||
docvariables carriage return formatting | Mailmerge | |||
Inconsistent formatting in TOC -- bold/not bold | Microsoft Word Help | |||
how do i make a sentence bold without making everything bold? | Microsoft Word Help |