Office Word Programming >> bind checkbox to merge field

by forman.hal » Tue, 13 May 2008 22:47:01 GMT

Hi, I have a checkbox that i want to be checked when the value of a
certain merge field is 1 and un-checked when the value of the same
merge field is 0. It seems like this should be a simple thing to do,
but I can't find it. I have Word 2003 and I am not an expert
programmer.

Thanks!


Office Word Programming >> bind checkbox to merge field

by Doug Robbins - Word MVP » Wed, 14 May 2008 03:43:27 GMT


Use an If...then...Else field construction where you insert the symbol of
the checked and unchecked box in place of checked and unchecked in the
following

{ IF { MERGEFIELD fieldname } = 1 checked unchecked }

You get the symbols from the Insert>Symbol menu item from the Wingdings
collection

You must use Ctrl+F9 to insert each pair of the field delimiters { }

--
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








Similar Threads

1. Merge data if database checkbox field is True

2. Mail Merge and checkbox form fields

How do I change the value of a checkbox field in word from a mail merge.  Any 
examples?

3. problems with getting both text fields and checkbox fields to work - Word Document management

4. Early binding works, late binding doesn't

Hi All,
This one got me stumped. Under what conditions would similar late
binding code fail where the early binding code works?

I'm using Wndows XP, Access 2003, and Adobe Acrobat 6 Pro. All at
latest service pack. The goal is to convert a postscript file to a PDF
file using Distiller's FileToPDF method.

This early binding code works:
    'Ensure you have a reference to Adobe.Distiller
    Const PS_FILENAME As String = "c:\junk\junk.ps"
    Const PDF_FILENAME As String = "c:\junk\junk.pdf"
    Dim objDistiller As New ACRODISTXLib.PdfDistiller
    objDistiller.FileToPDF PS_FILENAME, PDF_FILENAME, ""
    Set objDistiller = Nothing

This late binding code does not work. Both GetObject and CreateObject
fail with Err=429=ActiveX component can't create object. I tried a
different machine - same problem.
Why?
    Const PS_FILENAME As String = "c:\junk\junk.ps"
    Const PDF_FILENAME As String = "c:\junk\junk.pdf"
    Const DISTILLER_CLASS As String = "ACRODISTXLib.PdfDistiller"
    Dim objDistiller    As Object
    On Error Resume Next
    Set objDistiller = GetObject(, DISTILLER_CLASS) ' <==
Err=429=ActiveX component can't create object
    If Err.Number <> 0 Then
        Err.Clear
        Set objDistiller = CreateObject(DISTILLER_CLASS)  ' <==
Err=429=ActiveX component can't create object
        If Err.Number <> 0 Then
            Err.Clear
            MsgBox "Unable to create Distiller object. Acrobat not
installed?", vbCritical
        End If
    End If
    On Error GoTo 0
    If Not objDistiller Is Nothing Then
        objDistiller.FileToPDF PS_FILENAME, PDF_FILENAME, ""
    End If
    Set objDistiller = Nothing

Thanks for any insights,
-Tom.

5. Late binding and early binding

6. Late binding, Bound OLE Object, Access and Word

I cannot manage to make this work. I am just trying to have a Word-
document in a bound OLE object in an Access-form. I need to use late-
binding because it needs to work in different Office versions.

- I want to open an existing object and add text from my form to
predefined Bookmarks.
- I want to create a new OLE object

I use an existing Template ex: "C:\MyDoc.doc"

I have found a lot of information about late binding and defining
Objects, but how do I connect it to my Bound OLE-object?

In the examples on Microsoft's webpage it is all about creating a new
document adding some text and quit. I want to use my dokument, open an
existing object etc., etc.

Please, please help me. I am lost after many different tries!

7. Binding a Control to a Field at runtime

8. binding money fields from DIP

Hi, 
we have a money fields in our document information panel which we like to 
bind within the word-document. Doing so using quick parts, the 
document-control displays 10.000000000000 instead of the original entry in 
the dip which is like 10.00 $.
There seem to be no way to format the quick part in any way within the GUI 
of word. Is there any way to bring the quick part in the correct formatting?

best regards, 
Heyko