Reply
 
Thread Tools Display Modes
  #1   Report Post  
Terrycoco Terrycoco is offline
Junior Member
 
Posts: 0
Default docVariables come out bold

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   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default docVariables come out bold

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   Report Post  
Terrycoco Terrycoco is offline
Junior Member
 
Posts: 0
Lightbulb

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
TOC heading 1 text bold, dot leaders and page number NOT bold Donna Microsoft Word Help 4 November 21st 08 03:39 PM
When I apply bold to a word the whole document goes bold - ? mikisdad Microsoft Word Help 2 July 25th 08 04:32 AM
docvariables carriage return formatting Eric Mailmerge 2 March 2nd 07 10:40 PM
Inconsistent formatting in TOC -- bold/not bold Henslow Microsoft Word Help 4 December 6th 06 02:54 PM
how do i make a sentence bold without making everything bold? drbob1125 Microsoft Word Help 1 August 15th 06 03:30 AM


All times are GMT +1. The time now is 03:35 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"