![]() |
|
#1
|
||||
|
||||
![]()
The running of the Update macro is controlled by the Checkbox - it's properties show the macro is assigned to the formfield's Exit event.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Thank you again.
After a half hour of trial and error, I discovered that the way to have the bookmarked text from Text1 come in when the checkbox is checked, rather than unchecked, was to remove from the macro the " + 1" at the end of the line Code:
.CustomDocumentProperties("CheckNo").Value = .FormFields("Check1").Result + 1 Error! Bookmark not defined. when the box is unchecked, but I can live with that. I had just thought that it would return nothing, i.e., the empty paragraph of the second bookmark. I realize and respect that code is as plain as English to you, but since the mechanics of all this still remain obscure to me, an hour of attempts has failed in creating a first additional check box and includetext field to add additional bookmarked text from the source doc. I simply don’t know what to change, though I thought I had grasped the process. I have, strangely, been able to repeat exactly what the field you created does, with the same text brought in, even though I created a CheckNo2 custom document property, and two more bookmarks with another paragraph and another empty one. I tried duplicating the Update macro as Update2 and changing the line shown above to Code:
.CustomDocumentProperties("CheckNo2").Value = .FormFields("Check2").Result If I may ask you to once again correct my error, perhaps I can see where the difference lies and use that for all the additional check boxes and future documents I need to create. Best, Philip |
#3
|
||||
|
||||
![]() 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] |
#4
|
|||
|
|||
![]()
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 |
![]() |
|
![]() |
||||
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 |