![]() |
#16
|
||||
|
||||
![]() Quote:
Doing it the way you did means the field then looks for a bookmark named Check0 in the source document. If you were to add one, the error would go away. Quote:
Attached is an update to the demo files. the destination file now has two checkboxes, updating Custom Document Properties CheckA & CheckB that the INCLUDETEXT fields now refer to, for the purposes of retrieving bookmarks Check1, Check2, Check3 & Check4 from the source file.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#17
|
|||
|
|||
![]()
I hope you can still laugh, rather than mutter something, at my evident talent for confusion. Your latest explanation was very helpful. Over the last couple of hours, I have looked carefully at all the variables, simplified the document to make it clearer for me, and tried to get everything exactly right. I have apparently only one small issue remaining.
Let me explain first, that the source doc now has four paragraphs, bookmarked 1-4 in order: 1 & 3 have English text with their respective bookmark numbers, 2 & 4 are empty. I have been over and over the macros, the doc properties, and the checkbox properties and can't solve the following mystery (I am attaching a quick reference table of settings that I hope will save you the time of looking into the folder containing my current documents.): If checkbox 1 brings in the text when checked, it brings in paragraph 3, not 1. The result is the same as checking checkbox 2. When I get checkbox 1 to bring in paragraph 1, as it should, it will only do it when it is unchecked; the checked state brings in a blank. OK, how am I doing this: Your last response explained how to change the value of "+ (digit)" at the end of the macro line, to reverse the checked and unchecked results. Checkbox 2 works fine this way with that value as 2. However, if the value in the macro for checkbox 1 is 2, it returns paragraph 3; if the value is one, it returns paragraph one, but only when unchecked. In the attached folder, I have left both boxes unchecked, with checkbox 1 returning paragraph 3. Please, what am I not seeing here? Cordially, Philip |
#18
|
||||
|
||||
![]()
OK, so you have two checkboxes (CheckA & CheckB) and four bookmarks (Check1, Check2, Check3 & Check4).
Using the solution I provided in my last post: 1. CheckA references Check1 when unchecked and Check2 when checked; and 2. CheckB references Check3 when unchecked and Check4 when checked. You want to invert the behaviour. There are at least four ways of doing this that come to mind. Using the solution I provided in my last post, you could either: 1. swap the bookmarks around in the source document, so that - • Check1 applies to what Check2 now applies to, and vice versa; and • Check3 applies to what Check4 now applies to, and vice versa; or 2. modify the macros so that - • .FormFields("Check1").Result + 1 becomes 2 - .FormFields("Check1").Result; and • .FormFields("Check2").Result + 3 becomes 4 - .FormFields("Check2").Result; or 3. modify the source document and modify the macros thus: • add an empty bookmark named Check 0 to the source document; • change '.FormFields("Check1").Result + 1' to '.FormFields("Check1").Result'; and • change '.FormFields("Check2").Result + 3' to '.FormFields("Check2").Result +2'; or 4. modify the source document and modify the macros thus: • add an empty bookmark named Check 0 to the source document; • re-assign the Check2 bookmark to range now spanned by Check4; • delete the Check3 & Check4 bookmarks; and • change '.FormFields("Check1").Result + 1' to '.FormFields("Check1").Result * 1'; and • change '.FormFields("Check2").Result + 3' to '.FormFields("Check2").Result * 2'. The reason I refer to the solution I provided in my last post is that, in your attachment, you've edited the macros so that both refer to their formfield result '+ 2', which means their INCLUDETEXT fields point to the same boomarks in the source document...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#19
|
|||
|
|||
![]()
Dear Paul,
With some work, I did manage to get one of your several instructions to function in the previous document. You have been extremely patient and generous with your time -- above and beyond, as the phrase goes -- and it is my own mental blocks to grasping the operations that have drawn this out so long. I am quite at home with multiple variables in other realms, such as photographic controls, but I have a terrible time understanding the relations of between the macro, document properties, form fields, and bookmarks. I shall just have to keep working at it, with printouts of your posts and a calm attitude. I hope I may some day return the favor, if not directly to you, perhaps by helping someone else with something I do understand. Best wishes, Philip |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
mortcr | Word VBA | 1 | 10-22-2013 02:02 PM |
![]() |
DBrooks | Word | 1 | 02-16-2013 01:32 PM |
![]() |
David C | Word | 1 | 10-24-2012 04:53 AM |
![]() |
kellyjb27 | Word | 1 | 05-26-2012 11:08 AM |
![]() |
LAssist2011 | Word | 5 | 12-14-2011 03:02 PM |