View Single Post
  #8  
Old January 31st 06, 11:40 AM posted to microsoft.public.outlook.program_forms
Martin
external usenet poster
 
Posts: 87
Default Problem Printing Customized Outlook Form using Word Template

In case it's helpful to anyone, this is what I used to deal with the problem
(in can be adapted for either option buttons or checkboxes):

For counter = 1 to intBkList
strField = Trim(objWord.ActiveDocument.Bookmarks(counter))
Set objPage =Item.GetInspector.ModifiedFormPages("Message")
Set objControl = objPage.Controls(strField)
strField1 = objControl.Value
If strField1 = True then
strField2 = "¤"
ElseIf strField1 = False then
strField2 = "¡"
Else
strField2 = strField1
End If
objWord.ActiveDocument.Bookmarks(strField).Range.T ext = Cstr(strField2)
Next

Forget option buttons/check boxes in Word: it's only being used for the
printout so make sure the correct areas of your template are formatted to
Wingdings and use this code to drop in the right symbol!


"ajkim001" wrote:

FYI~ I used the code and it works perfectly... )

"Sue Mosher [MVP-Outlook]" wrote:

You should to set the check box's Value property explictly, and the expression you set it to must be a True/False expression:

oDoc.FormFields("FieldName").CheckBox.Value = item.userproperties("FieldName")
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"ajkim001" wrote in message ...
I created an OL form and used the Sub cmdPrint_Click code to print the form
data. I got the oDoc.FormFields ("FieldName").Result = item.userproperties
("FieldName") part working. However, I'm having trouble with the checkboxes
and radio buttons. I've tried using oDoc.FormFields("FieldName").CheckBox =
item.userproperties("FieldName") but it doesn't work. Maybe I'm missing
something or is there a different code that I need to use to transfer the
data to the Word template?

I hope someone has the answer to this. I've searched online and in Word and
Outlook books to no avail. Thank you!


Ads