Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-15-2018, 04:46 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 xml error .docm

Hi Everyone,

I have a .docm file that we use as a template.



We have this document being used by quite a few people, however it seems that just 1 user has an issue using the template.

After he has added all the information to the document, after he saves it and tries to open it again we get an xml error (See screenshot) and everything in the document becomes static (i.e-check boxes etc)

I wanted to know what this error relates to and how can i resolve the error?

Thanks in advance
Attached Images
File Type: png Capture.PNG (6.5 KB, 25 views)
Reply With Quote
  #2  
Old 04-15-2018, 05:08 PM
eduzs eduzs is offline xml error .docm Windows 10 xml error .docm Office 2010 32bit
Expert
 
Join Date: May 2017
Posts: 262
eduzs is on a distinguished road
Default

The user enabled vba macros in security options?
The word version is the same?
__________________
Backup your original file before doing any modification.
Reply With Quote
  #3  
Old 04-15-2018, 06:01 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 Mate,

Thanks for your quick response.

Yes the vba security macros has been enabled.

The user is currently using Word 2013. I'm not sure which word version was used to code the docm.

How do i find out which version was used to code the docm?

I am considering to upgrade the user to Word 2016 but want to know if this issue will be resolved in that version?

Another user is using Word 2010 and the same document, however does not have any issues.

Thanks in advance
Reply With Quote
  #4  
Old 04-15-2018, 07:28 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: 21,963
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

The error is caused by malformed XML tags in the document's XML code; it has nothing to do with macros. Since only one user is affected, you might try repairing that user's Office installation (via Windows Control Panel > Programs > Programs & Features > Microsoft Office (version) > Change > Repair).

Word MVP Doug Robbins has repaired numerous such documents. See, for example: https://answers.microsoft.com/en-us/...d-fef1aba81664
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 04-15-2018, 10:21 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 There,

Thank you for your response.

After some further investigation, i have identified that other users also have the issues relating to the document.

I am attaching a copy of the template.

Any help with the coding if you can identify issues is appreciated.

We also use Nuance Dragon to key in the information which is a speech to text software.

link for template:

https://1drv.ms/f/s!AsoodcrgBMWgiRjVbIDPHpylvOEm

Thanks
Reply With Quote
  #6  
Old 04-15-2018, 11:32 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: 21,963
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

The problem is most likely related to your use of ActiveX checkboxes. That can be overcome by replacing the Yes/No ActiveX checkbox sets and & Yes/No/Refer Fact Find content control checkboxes (which don't enforce an exclusive choice) with content control dropdowns giving the same options and by replacing the single-choice ActiveX checkboxes with content control checkboxes. Naturally, that will require some coding changes, too.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 04-16-2018, 12:32 AM
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 Macropod,

Thank you for your quick response.

After some testing, I have found that the document gets corrupted when the user puts information in the highlighted section (Refer attached pic) on page 3.

Is there anything you can observe relating to that particular section that you feel may be causing the issue?

Thanks
Attached Images
File Type: png Capture.PNG (18.0 KB, 24 views)
Reply With Quote
  #8  
Old 04-16-2018, 12:54 AM
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: 21,963
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

Where the corruption manifests in the document may or may not be related to where the problem exists in the xml code; it could actually be in the code related to the preceding ActiveX checkbox, for example. The only way of finding out for sure is by examining the underlying xml code.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 04-16-2018, 01:39 AM
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 Mate, what would i need to do to examine the underlying xml code?

Thanks again
Reply With Quote
  #10  
Old 04-16-2018, 04:29 AM
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: 21,963
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

Getting access to it is simple enough - change the file's extension to .zip then open the file as a zip archive. In there is a file named 'document.xml' and the error is located somewhere in that file. You'll need an application like Notepad++ to examine the xml structure. Beyond that, though, I really don't know enough about xml coding to give much advice, other than to say the problem is usually the result of a missing end-tag of one kind or another.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 04-16-2018, 05:54 AM
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 Mate,

I extracted the document.xml code and ran it through an xml checker and no errors were found.

https://www.w3schools.com/xml/xml_validator.asp

I also opened a damaged document and ran that code through the checker and everything came back fine.

Not sure why this issue is still present.

If I were to incorporate the use of content check box as you describe above, how would I go about coding it? The check boxes do not contain any events, so how would the code need to be written?

Can it perform similar functions such as an active x control?

Are there any resources you can point me in so I could look up how code can be written with such controls?

Thanks
Reply With Quote
  #12  
Old 04-16-2018, 03:24 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: 21,963
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

Quote:
Originally Posted by lord_kaiser View Post
I extracted the document.xml code and ran it through an xml checker and no errors were found.
If you're checking a document that isn't returning the error, that's not surprising.
Quote:
Originally Posted by lord_kaiser View Post
I also opened a damaged document and ran that code through the checker and everything came back fine.

Not sure why this issue is still present.
At a guess, it seems the document might be corrupting upon opening - which suggests the Office installation on that PC might need repairing. As I said, though, it's just a guess.
Quote:
Originally Posted by lord_kaiser View Post
If I were to incorporate the use of content check box as you describe above, how would I go about coding it? The check boxes do not contain any events, so how would the code need to be written?
If the existing checkboxes don't trigger any code, there's nothing to change in that regard by switching over to content control checkboxes. That said, I'd still be inclined to replace the
Quote:
Yes/No ActiveX checkbox sets and & Yes/No/Refer Fact Find content control checkboxes (which don't enforce an exclusive choice) with content control dropdowns giving the same options
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #13  
Old 04-16-2018, 07:17 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 your response.

I've started to amend the template by removing all the the activex controls.

In the event i would like to add CC Checkboxes (Yes/No), how would i code it that if one CC checkbox is selected the other is disabled and vice versa?

Thanks
Reply With Quote
  #14  
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: 21,963
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, 9 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #15  
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
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 04:10 PM.


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