Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2017, 07:49 PM
Dully Dully is offline Preventing error in caption numbering Windows 10 Preventing error in caption numbering Office 2010 32bit
Novice
Preventing error in caption numbering
 
Join Date: May 2017
Posts: 2
Dully is on a distinguished road
Default Preventing error in caption numbering

Word 2010. I have outlined numbered headings in a template.
Table captions include chapter number (ie Table 1.1, Table 2.1 etc).


Headings in Appendix section use heading style 6 and return appendix character of heading 6 style (ie Table A1, Table B1).
If heading 1 style is changed to no numbering to avoid an error, I've included in the code "{If {STYLEREF 1\s}<> "Error*"{STYLEREF 1\s}}.{SEQ Table \* ARABIC \s 1}"
After a heading 6 style "{SEQ Table \* ARABIC \s 6}".

My question is this, is there a way to combine the code using an If statement or something?? so that it doesn't matter whether the previous heading style is 1 or 6, if the numbered style is present, then Table 1.1 or Table A1 will be returned.
If heading 1 style is unnumbered, then Table 1 will be returned, but still return Table A1 after heading 6 style.

To complicate this further, there is a period "." between the IF STYLEREF field and the SEQ field for captions linked to heading 1 style. I'd like this to be eliminated also. The user needs to have the choice of numbering or not, without messing up caption numbering and cross-referencing. Can this be done?

I'd appreciate ANY help. Thank you.

Last edited by Charles Kenyon; 05-19-2017 at 07:11 AM. Reason: Add paragraphs so I can read it.
Reply With Quote
  #2  
Old 05-18-2017, 11:38 PM
Guessed's Avatar
Guessed Guessed is offline Preventing error in caption numbering Windows 10 Preventing error in caption numbering Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,980
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

It doesn't appear to be possible. You would need to nest both the prefix and seq field but the Seq field double counts even when one is not visible (so the table numbers double each time. For instance, the following looked promising

Table {If{StyleRef "Heading 6" \p} = below "{StyleRef \s 1 \n \# "0."}" "{StyleRef \s 6 \n}"}{If{StyleRef "Heading 6" \p} = below "{Seq Table \s 1}" "{Seq Table \s 6}"}

Even if you could get it to work, it would require additional constructions to deal with either Heading 1 or 6 not being numbered OR not being present in the document.

I think you are going to need a macro to do your captions and deal with all the variables you have asked for. Such a macro would be possible but the variations make it complex.

Why don't you just setup each of the caption variants you want and save them as quickparts and then insert the relevant one wherever it is needed?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 05-19-2017, 03:22 PM
Dully Dully is offline Preventing error in caption numbering Windows 10 Preventing error in caption numbering Office 2010 32bit
Novice
Preventing error in caption numbering
 
Join Date: May 2017
Posts: 2
Dully is on a distinguished road
Default

Thanks for your response. Much appreciated.

OK, so it looks like it might be too difficult.

I was trying to avoid the issues that arise when a user moves a captioned object from one part of a document to another, ie a captioned object would be moved from an appendix to a regular section and thus should be referencing Heading 1, not Heading 6 or vice versa.

I have the objects (including the relevant caption) inserted via macro as QuickParts and labelled as Table and Appendix Table to provide the relevant caption numbering. This works well.

Rather than doing an all-in-one approach, is there a simple way then to just eliminate the "." which remains when the numbering of heading 1 is removed.

I need table caption to return "Table 1.1" with a numbered heading 1 style, or "Table 1" with a non numbered heading 1 style. I'm currently getting "Table .1" with a non numbered heading 1 style.

My current field code is "{If {STYLEREF 1\s}<> "Error*"{STYLEREF 1\s}}.{SEQ Table \* ARABIC \s 1}"

Thanks again for your time.
Reply With Quote
  #4  
Old 05-20-2017, 10:44 PM
Guessed's Avatar
Guessed Guessed is offline Preventing error in caption numbering Windows 10 Preventing error in caption numbering Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,980
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Did you notice how I included the "." in the heading number formatting?
{StyleRef \s 1 \n \# "0."}

Try incorporating that into your nested formula.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Tags
caption numbering word, field codes, word 2010



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2010 Run-Time error 4198 with Insert Picture with Caption and Fram Macro jstills116 Word VBA 0 06-24-2016 07:46 AM
Preventing error in caption numbering Caption numbering problems welsom2689 Word 13 04-01-2015 01:02 AM
Word 2011 MAC - caption numbering problem aureiphi Word 9 07-22-2013 02:47 AM
MS Word figure caption numbering skaboy607 Word 3 03-21-2012 02:31 PM
Multilevel caption numbering timpy Word 0 08-03-2011 09:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:19 AM.


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