Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-16-2018, 08:03 PM
macropod's Avatar
macropod macropod is offline xml error .docm Windows 7 64bit xml error .docm Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For that you'd need to employ a ContentControlOnExit in the ThisDocument module of the document or its template, coded along the lines of:
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Select Case CCtrl.Title
  Case "MyCheck"
    With ActiveDocument.SelectContentControlsByTitle("MyCheck")
      If CCtrl.Tag = "Yes" Then
        .Item(2).Checked = Not CCtrl.Checked
      ElseIf CCtrl.Tag = "No" Then
        .Item(1).Checked = Not CCtrl.Checked
      End If
    End With
End Select
End Sub
Where the pair of checkbox content controls both have the Title 'MyCheck' and one of the pair has the Tag 'Yes' whilst the other has the Tag 'No'.

See attached.
Attached Files
File Type: docm Checkboxes.docm (31.0 KB, 11 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 04-16-2018, 08:38 PM
lord_kaiser lord_kaiser is offline xml error .docm Windows 10 xml error .docm Office 2016
Novice
xml error .docm
 
Join Date: Apr 2018
Posts: 13
lord_kaiser is on a distinguished road
Default

Hi Paul,

Thank you for the help.

I still seem to be having issues as when switching between th eboxes, the selected value disappears.

here is my code:

Code:
  Case "chkYNEstatePlanning"
 
  
    With ActiveDocument.SelectContentControlsByTitle("chkYNEstatePlanning")
     If CC.ShowingPlaceholderText Then GoTo lbl_Exit
      If CC.Tag = "Yes" Then
        .Item(2).Checked = Not CC.Checked
      ElseIf CC.Tag = "No" Then
        .Item(1).Checked = Not CC.Checked
      End If
    End With
 Case Else
 End Select
lbl_Exit:
  Application.ScreenUpdating = True
  Exit Sub

End Sub
Reply With Quote
  #3  
Old 04-16-2018, 09:09 PM
lord_kaiser lord_kaiser is offline xml error .docm Windows 10 xml error .docm Office 2016
Novice
xml error .docm
 
Join Date: Apr 2018
Posts: 13
lord_kaiser is on a distinguished road
Default

Ok,

I think i sorted it out and it works.

For some reason i deleted the controls and added them in again and then it worked.
Reply With Quote
Reply

Tags
.docm, xml issue



Similar Threads
Thread Thread Starter Forum Replies Last Post
xml error .docm Word VBA docm to dotm problem spider85 Word VBA 2 04-17-2017 02:08 AM
xml error .docm SaveAs docm file from template ptmuldoon Word VBA 7 03-09-2015 05:38 PM
xml error .docm DOCM file not saving on Microsoft Word 2010 flutterby1 Word 4 10-08-2014 10:55 AM
xml error .docm How to convert docm to dotm without opening the file Moz Word 1 12-20-2012 04:23 PM
Docm content dissapearing when I open the file? shabbaranks Word 2 07-18-2012 01:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft