Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Automating call-out alignment in double-page documents
I am using Word 2003 under Windows XP.
I have received a number of long double-page documents for a university course, all of which are surprisingly well and consistently formatted. Most body text paragraphs are accompanied by a short call-out in the outer margin. The call-out style includes "Keep with next" so that it always stays glued to the beginning of the home paragraph, even if the latter changes pages. The formatting also ensures that the call-out stays in the outer margin, i.e. left on even pages, right on odd pages. Problem: The call-out has to be right-aligned on even pages, left-aligned on odd pages, i.e. the flush side of the call-out is always nearest the body text. In the German source text, this has been done manually, which is obviously a nuisance and error-prone. Is there any way of automating the alignment so that the call-out senses whether it is on an even or an odd page and switches the paragraph alignment accordingly? Alternatively, could one easily build a macro that would run through the document applying left and right call-out styles appropriately depending on the page side? -- olitrans Technical Translator Germany |
#2
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Automating call-out alignment in double-page documents
Assuming the "callout" is a frame, the position of the frame can be set to
"Outside." See http://sbarnhill.mvps.org/WordFAQs/MarginalText.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... I am using Word 2003 under Windows XP. I have received a number of long double-page documents for a university course, all of which are surprisingly well and consistently formatted. Most body text paragraphs are accompanied by a short call-out in the outer margin. The call-out style includes "Keep with next" so that it always stays glued to the beginning of the home paragraph, even if the latter changes pages. The formatting also ensures that the call-out stays in the outer margin, i.e. left on even pages, right on odd pages. Problem: The call-out has to be right-aligned on even pages, left-aligned on odd pages, i.e. the flush side of the call-out is always nearest the body text. In the German source text, this has been done manually, which is obviously a nuisance and error-prone. Is there any way of automating the alignment so that the call-out senses whether it is on an even or an odd page and switches the paragraph alignment accordingly? Alternatively, could one easily build a macro that would run through the document applying left and right call-out styles appropriately depending on the page side? -- olitrans Technical Translator Germany |
#3
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Automating call-out alignment in double-page documents
Many thanks for the suggestion, but it doesn't go far enough! The call-out is
indeed in a frame, which is already set to "outside". That takes care of which side of the page the call-out appears. My problem is the text alignment of the paragraph within the frame: right on even pages, left on odd. In the past this has been done manually shortly before printing. I would like to automate it, but cannot see any way of enabling the style to sense whether the call-out is on an odd or even page and switch its horizontal text alignment accordingly. I have even wondered about the possibility of a formula triggering an appropriate macro, possibly tucked away as hidden text in a paragraph number format. But I am basically an overworked translator, not a Word wizard, and do not have unlimited time for experiments of this kind. -- olitrans Technical Translator Germany "Suzanne S. Barnhill" wrote: Assuming the "callout" is a frame, the position of the frame can be set to "Outside." See http://sbarnhill.mvps.org/WordFAQs/MarginalText.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... I am using Word 2003 under Windows XP. I have received a number of long double-page documents for a university course, all of which are surprisingly well and consistently formatted. Most body text paragraphs are accompanied by a short call-out in the outer margin. The call-out style includes "Keep with next" so that it always stays glued to the beginning of the home paragraph, even if the latter changes pages. The formatting also ensures that the call-out stays in the outer margin, i.e. left on even pages, right on odd pages. Problem: The call-out has to be right-aligned on even pages, left-aligned on odd pages, i.e. the flush side of the call-out is always nearest the body text. In the German source text, this has been done manually, which is obviously a nuisance and error-prone. Is there any way of automating the alignment so that the call-out senses whether it is on an even or an odd page and switches the paragraph alignment accordingly? Alternatively, could one easily build a macro that would run through the document applying left and right call-out styles appropriately depending on the page side? -- olitrans Technical Translator Germany |
#4
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Automating call-out alignment in double-page documents
Ah, I see. I misread your question. The answer would be in two separate
styles, one left-aligned and one right, but then you'd need a macro to run through the document looking at each frame, figuring out which side of the page it was on, and applying the appropriate style. It may be that this is possible with VBA, but I wouldn't bet on it. It sounds as if either a redesign or a continuation of the manual labor is indicated. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... Many thanks for the suggestion, but it doesn't go far enough! The call-out is indeed in a frame, which is already set to "outside". That takes care of which side of the page the call-out appears. My problem is the text alignment of the paragraph within the frame: right on even pages, left on odd. In the past this has been done manually shortly before printing. I would like to automate it, but cannot see any way of enabling the style to sense whether the call-out is on an odd or even page and switch its horizontal text alignment accordingly. I have even wondered about the possibility of a formula triggering an appropriate macro, possibly tucked away as hidden text in a paragraph number format. But I am basically an overworked translator, not a Word wizard, and do not have unlimited time for experiments of this kind. -- olitrans Technical Translator Germany "Suzanne S. Barnhill" wrote: Assuming the "callout" is a frame, the position of the frame can be set to "Outside." See http://sbarnhill.mvps.org/WordFAQs/MarginalText.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... I am using Word 2003 under Windows XP. I have received a number of long double-page documents for a university course, all of which are surprisingly well and consistently formatted. Most body text paragraphs are accompanied by a short call-out in the outer margin. The call-out style includes "Keep with next" so that it always stays glued to the beginning of the home paragraph, even if the latter changes pages. The formatting also ensures that the call-out stays in the outer margin, i.e. left on even pages, right on odd pages. Problem: The call-out has to be right-aligned on even pages, left-aligned on odd pages, i.e. the flush side of the call-out is always nearest the body text. In the German source text, this has been done manually, which is obviously a nuisance and error-prone. Is there any way of automating the alignment so that the call-out senses whether it is on an even or an odd page and switches the paragraph alignment accordingly? Alternatively, could one easily build a macro that would run through the document applying left and right call-out styles appropriately depending on the page side? -- olitrans Technical Translator Germany |
#5
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Automating call-out alignment in double-page documents
Thank you, if only for confirmation that I have not missed an obvious
possibility. I was beginning to come to the same conclusion myself! -- olitrans Technical Translator Germany "Suzanne S. Barnhill" wrote: Ah, I see. I misread your question. The answer would be in two separate styles, one left-aligned and one right, but then you'd need a macro to run through the document looking at each frame, figuring out which side of the page it was on, and applying the appropriate style. It may be that this is possible with VBA, but I wouldn't bet on it. It sounds as if either a redesign or a continuation of the manual labor is indicated. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... Many thanks for the suggestion, but it doesn't go far enough! The call-out is indeed in a frame, which is already set to "outside". That takes care of which side of the page the call-out appears. My problem is the text alignment of the paragraph within the frame: right on even pages, left on odd. In the past this has been done manually shortly before printing. I would like to automate it, but cannot see any way of enabling the style to sense whether the call-out is on an odd or even page and switch its horizontal text alignment accordingly. I have even wondered about the possibility of a formula triggering an appropriate macro, possibly tucked away as hidden text in a paragraph number format. But I am basically an overworked translator, not a Word wizard, and do not have unlimited time for experiments of this kind. -- olitrans Technical Translator Germany "Suzanne S. Barnhill" wrote: Assuming the "callout" is a frame, the position of the frame can be set to "Outside." See http://sbarnhill.mvps.org/WordFAQs/MarginalText.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... I am using Word 2003 under Windows XP. I have received a number of long double-page documents for a university course, all of which are surprisingly well and consistently formatted. Most body text paragraphs are accompanied by a short call-out in the outer margin. The call-out style includes "Keep with next" so that it always stays glued to the beginning of the home paragraph, even if the latter changes pages. The formatting also ensures that the call-out stays in the outer margin, i.e. left on even pages, right on odd pages. Problem: The call-out has to be right-aligned on even pages, left-aligned on odd pages, i.e. the flush side of the call-out is always nearest the body text. In the German source text, this has been done manually, which is obviously a nuisance and error-prone. Is there any way of automating the alignment so that the call-out senses whether it is on an even or an odd page and switches the paragraph alignment accordingly? Alternatively, could one easily build a macro that would run through the document applying left and right call-out styles appropriately depending on the page side? -- olitrans Technical Translator Germany |
#6
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Automating call-out alignment in double-page documents
I think the macro below will do what you want. The macro iterates through all
frames in the active document. If the frame has the Horizontal Position set to "Outside", the macro finds out which page number the frame is on. In order to find out whether the page number is even or odd, the number is divided by 2. If the remainder is 0, it is an even page and the text in the frame is aligned left. Else, it is an odd page and the text in the frame is aligned right. You will need to run the macro each time changes to the document results in frames moving from one page to another. Sub FramesInMargin_ChangeAlignment_EvenOdd() Dim oFrm As Frame For Each oFrm In ActiveDocument.Frames If oFrm.HorizontalPosition = wdFrameOutside Then If oFrm.Range.Information(wdActiveEndPageNumber) Mod 2 = 0 Then 'even page number oFrm.Range.ParagraphFormat.Alignment = wdAlignParagraphRight Else 'odd page number oFrm.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft End If End If Next oFrm End Sub If you need help on installing macros, see: http://www.gmayor.com/installing_macro.htm Note: Suzanne's last post appeared while I created and tested the macro above. I have not introduced a second style. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "Suzanne S. Barnhill" wrote: Ah, I see. I misread your question. The answer would be in two separate styles, one left-aligned and one right, but then you'd need a macro to run through the document looking at each frame, figuring out which side of the page it was on, and applying the appropriate style. It may be that this is possible with VBA, but I wouldn't bet on it. It sounds as if either a redesign or a continuation of the manual labor is indicated. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... Many thanks for the suggestion, but it doesn't go far enough! The call-out is indeed in a frame, which is already set to "outside". That takes care of which side of the page the call-out appears. My problem is the text alignment of the paragraph within the frame: right on even pages, left on odd. In the past this has been done manually shortly before printing. I would like to automate it, but cannot see any way of enabling the style to sense whether the call-out is on an odd or even page and switch its horizontal text alignment accordingly. I have even wondered about the possibility of a formula triggering an appropriate macro, possibly tucked away as hidden text in a paragraph number format. But I am basically an overworked translator, not a Word wizard, and do not have unlimited time for experiments of this kind. -- olitrans Technical Translator Germany "Suzanne S. Barnhill" wrote: Assuming the "callout" is a frame, the position of the frame can be set to "Outside." See http://sbarnhill.mvps.org/WordFAQs/MarginalText.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... I am using Word 2003 under Windows XP. I have received a number of long double-page documents for a university course, all of which are surprisingly well and consistently formatted. Most body text paragraphs are accompanied by a short call-out in the outer margin. The call-out style includes "Keep with next" so that it always stays glued to the beginning of the home paragraph, even if the latter changes pages. The formatting also ensures that the call-out stays in the outer margin, i.e. left on even pages, right on odd pages. Problem: The call-out has to be right-aligned on even pages, left-aligned on odd pages, i.e. the flush side of the call-out is always nearest the body text. In the German source text, this has been done manually, which is obviously a nuisance and error-prone. Is there any way of automating the alignment so that the call-out senses whether it is on an even or an odd page and switches the paragraph alignment accordingly? Alternatively, could one easily build a macro that would run through the document applying left and right call-out styles appropriately depending on the page side? -- olitrans Technical Translator Germany |
#7
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Automating call-out alignment in double-page documents
Ah, good approach, Lene. I hadn't thought of that possibility (but then I'm
not a coder). -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Lene Fredborg" wrote in message ... I think the macro below will do what you want. The macro iterates through all frames in the active document. If the frame has the Horizontal Position set to "Outside", the macro finds out which page number the frame is on. In order to find out whether the page number is even or odd, the number is divided by 2. If the remainder is 0, it is an even page and the text in the frame is aligned left. Else, it is an odd page and the text in the frame is aligned right. You will need to run the macro each time changes to the document results in frames moving from one page to another. Sub FramesInMargin_ChangeAlignment_EvenOdd() Dim oFrm As Frame For Each oFrm In ActiveDocument.Frames If oFrm.HorizontalPosition = wdFrameOutside Then If oFrm.Range.Information(wdActiveEndPageNumber) Mod 2 = 0 Then 'even page number oFrm.Range.ParagraphFormat.Alignment = wdAlignParagraphRight Else 'odd page number oFrm.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft End If End If Next oFrm End Sub If you need help on installing macros, see: http://www.gmayor.com/installing_macro.htm Note: Suzanne's last post appeared while I created and tested the macro above. I have not introduced a second style. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "Suzanne S. Barnhill" wrote: Ah, I see. I misread your question. The answer would be in two separate styles, one left-aligned and one right, but then you'd need a macro to run through the document looking at each frame, figuring out which side of the page it was on, and applying the appropriate style. It may be that this is possible with VBA, but I wouldn't bet on it. It sounds as if either a redesign or a continuation of the manual labor is indicated. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... Many thanks for the suggestion, but it doesn't go far enough! The call-out is indeed in a frame, which is already set to "outside". That takes care of which side of the page the call-out appears. My problem is the text alignment of the paragraph within the frame: right on even pages, left on odd. In the past this has been done manually shortly before printing. I would like to automate it, but cannot see any way of enabling the style to sense whether the call-out is on an odd or even page and switch its horizontal text alignment accordingly. I have even wondered about the possibility of a formula triggering an appropriate macro, possibly tucked away as hidden text in a paragraph number format. But I am basically an overworked translator, not a Word wizard, and do not have unlimited time for experiments of this kind. -- olitrans Technical Translator Germany "Suzanne S. Barnhill" wrote: Assuming the "callout" is a frame, the position of the frame can be set to "Outside." See http://sbarnhill.mvps.org/WordFAQs/MarginalText.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... I am using Word 2003 under Windows XP. I have received a number of long double-page documents for a university course, all of which are surprisingly well and consistently formatted. Most body text paragraphs are accompanied by a short call-out in the outer margin. The call-out style includes "Keep with next" so that it always stays glued to the beginning of the home paragraph, even if the latter changes pages. The formatting also ensures that the call-out stays in the outer margin, i.e. left on even pages, right on odd pages. Problem: The call-out has to be right-aligned on even pages, left-aligned on odd pages, i.e. the flush side of the call-out is always nearest the body text. In the German source text, this has been done manually, which is obviously a nuisance and error-prone. Is there any way of automating the alignment so that the call-out senses whether it is on an even or an odd page and switches the paragraph alignment accordingly? Alternatively, could one easily build a macro that would run through the document applying left and right call-out styles appropriately depending on the page side? -- olitrans Technical Translator Germany |
#8
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Automating call-out alignment in double-page documents
Many, many thanks - this looks impressive, and simpler than I expected! All
I need to do now is find the time to play with it! -- olitrans Technical Translator Germany "Lene Fredborg" wrote: I think the macro below will do what you want. The macro iterates through all frames in the active document. If the frame has the Horizontal Position set to "Outside", the macro finds out which page number the frame is on. In order to find out whether the page number is even or odd, the number is divided by 2. If the remainder is 0, it is an even page and the text in the frame is aligned left. Else, it is an odd page and the text in the frame is aligned right. You will need to run the macro each time changes to the document results in frames moving from one page to another. Sub FramesInMargin_ChangeAlignment_EvenOdd() Dim oFrm As Frame For Each oFrm In ActiveDocument.Frames If oFrm.HorizontalPosition = wdFrameOutside Then If oFrm.Range.Information(wdActiveEndPageNumber) Mod 2 = 0 Then 'even page number oFrm.Range.ParagraphFormat.Alignment = wdAlignParagraphRight Else 'odd page number oFrm.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft End If End If Next oFrm End Sub If you need help on installing macros, see: http://www.gmayor.com/installing_macro.htm Note: Suzanne's last post appeared while I created and tested the macro above. I have not introduced a second style. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "Suzanne S. Barnhill" wrote: Ah, I see. I misread your question. The answer would be in two separate styles, one left-aligned and one right, but then you'd need a macro to run through the document looking at each frame, figuring out which side of the page it was on, and applying the appropriate style. It may be that this is possible with VBA, but I wouldn't bet on it. It sounds as if either a redesign or a continuation of the manual labor is indicated. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... Many thanks for the suggestion, but it doesn't go far enough! The call-out is indeed in a frame, which is already set to "outside". That takes care of which side of the page the call-out appears. My problem is the text alignment of the paragraph within the frame: right on even pages, left on odd. In the past this has been done manually shortly before printing. I would like to automate it, but cannot see any way of enabling the style to sense whether the call-out is on an odd or even page and switch its horizontal text alignment accordingly. I have even wondered about the possibility of a formula triggering an appropriate macro, possibly tucked away as hidden text in a paragraph number format. But I am basically an overworked translator, not a Word wizard, and do not have unlimited time for experiments of this kind. -- olitrans Technical Translator Germany "Suzanne S. Barnhill" wrote: Assuming the "callout" is a frame, the position of the frame can be set to "Outside." See http://sbarnhill.mvps.org/WordFAQs/MarginalText.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... I am using Word 2003 under Windows XP. I have received a number of long double-page documents for a university course, all of which are surprisingly well and consistently formatted. Most body text paragraphs are accompanied by a short call-out in the outer margin. The call-out style includes "Keep with next" so that it always stays glued to the beginning of the home paragraph, even if the latter changes pages. The formatting also ensures that the call-out stays in the outer margin, i.e. left on even pages, right on odd pages. Problem: The call-out has to be right-aligned on even pages, left-aligned on odd pages, i.e. the flush side of the call-out is always nearest the body text. In the German source text, this has been done manually, which is obviously a nuisance and error-prone. Is there any way of automating the alignment so that the call-out senses whether it is on an even or an odd page and switches the paragraph alignment accordingly? Alternatively, could one easily build a macro that would run through the document applying left and right call-out styles appropriately depending on the page side? -- olitrans Technical Translator Germany |
#9
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Automating call-out alignment in double-page documents
Suzanne, you should try coding some day. I am sure you would enjoy it (at
least after a little while). -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "Suzanne S. Barnhill" wrote: Ah, good approach, Lene. I hadn't thought of that possibility (but then I'm not a coder). -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Lene Fredborg" wrote in message ... I think the macro below will do what you want. The macro iterates through all frames in the active document. If the frame has the Horizontal Position set to "Outside", the macro finds out which page number the frame is on. In order to find out whether the page number is even or odd, the number is divided by 2. If the remainder is 0, it is an even page and the text in the frame is aligned left. Else, it is an odd page and the text in the frame is aligned right. You will need to run the macro each time changes to the document results in frames moving from one page to another. Sub FramesInMargin_ChangeAlignment_EvenOdd() Dim oFrm As Frame For Each oFrm In ActiveDocument.Frames If oFrm.HorizontalPosition = wdFrameOutside Then If oFrm.Range.Information(wdActiveEndPageNumber) Mod 2 = 0 Then 'even page number oFrm.Range.ParagraphFormat.Alignment = wdAlignParagraphRight Else 'odd page number oFrm.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft End If End If Next oFrm End Sub If you need help on installing macros, see: http://www.gmayor.com/installing_macro.htm Note: Suzanne's last post appeared while I created and tested the macro above. I have not introduced a second style. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "Suzanne S. Barnhill" wrote: Ah, I see. I misread your question. The answer would be in two separate styles, one left-aligned and one right, but then you'd need a macro to run through the document looking at each frame, figuring out which side of the page it was on, and applying the appropriate style. It may be that this is possible with VBA, but I wouldn't bet on it. It sounds as if either a redesign or a continuation of the manual labor is indicated. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... Many thanks for the suggestion, but it doesn't go far enough! The call-out is indeed in a frame, which is already set to "outside". That takes care of which side of the page the call-out appears. My problem is the text alignment of the paragraph within the frame: right on even pages, left on odd. In the past this has been done manually shortly before printing. I would like to automate it, but cannot see any way of enabling the style to sense whether the call-out is on an odd or even page and switch its horizontal text alignment accordingly. I have even wondered about the possibility of a formula triggering an appropriate macro, possibly tucked away as hidden text in a paragraph number format. But I am basically an overworked translator, not a Word wizard, and do not have unlimited time for experiments of this kind. -- olitrans Technical Translator Germany "Suzanne S. Barnhill" wrote: Assuming the "callout" is a frame, the position of the frame can be set to "Outside." See http://sbarnhill.mvps.org/WordFAQs/MarginalText.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... I am using Word 2003 under Windows XP. I have received a number of long double-page documents for a university course, all of which are surprisingly well and consistently formatted. Most body text paragraphs are accompanied by a short call-out in the outer margin. The call-out style includes "Keep with next" so that it always stays glued to the beginning of the home paragraph, even if the latter changes pages. The formatting also ensures that the call-out stays in the outer margin, i.e. left on even pages, right on odd pages. Problem: The call-out has to be right-aligned on even pages, left-aligned on odd pages, i.e. the flush side of the call-out is always nearest the body text. In the German source text, this has been done manually, which is obviously a nuisance and error-prone. Is there any way of automating the alignment so that the call-out senses whether it is on an even or an odd page and switches the paragraph alignment accordingly? Alternatively, could one easily build a macro that would run through the document applying left and right call-out styles appropriately depending on the page side? -- olitrans Technical Translator Germany |
#10
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Automating call-out alignment in double-page documents
It's on my life list, so to speak (right up there with getting my daughter's
high school senior year scrapbook finished and getting back into the family genealogy), but the last coding I did was Autocoder-IOCS for an IBM 1401, and I have too much non-VBA-related work (and non-work) to do every day to get into that. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Lene Fredborg" wrote in message ... Suzanne, you should try coding some day. I am sure you would enjoy it (at least after a little while). -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "Suzanne S. Barnhill" wrote: Ah, good approach, Lene. I hadn't thought of that possibility (but then I'm not a coder). -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Lene Fredborg" wrote in message ... I think the macro below will do what you want. The macro iterates through all frames in the active document. If the frame has the Horizontal Position set to "Outside", the macro finds out which page number the frame is on. In order to find out whether the page number is even or odd, the number is divided by 2. If the remainder is 0, it is an even page and the text in the frame is aligned left. Else, it is an odd page and the text in the frame is aligned right. You will need to run the macro each time changes to the document results in frames moving from one page to another. Sub FramesInMargin_ChangeAlignment_EvenOdd() Dim oFrm As Frame For Each oFrm In ActiveDocument.Frames If oFrm.HorizontalPosition = wdFrameOutside Then If oFrm.Range.Information(wdActiveEndPageNumber) Mod 2 = 0 Then 'even page number oFrm.Range.ParagraphFormat.Alignment = wdAlignParagraphRight Else 'odd page number oFrm.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft End If End If Next oFrm End Sub If you need help on installing macros, see: http://www.gmayor.com/installing_macro.htm Note: Suzanne's last post appeared while I created and tested the macro above. I have not introduced a second style. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "Suzanne S. Barnhill" wrote: Ah, I see. I misread your question. The answer would be in two separate styles, one left-aligned and one right, but then you'd need a macro to run through the document looking at each frame, figuring out which side of the page it was on, and applying the appropriate style. It may be that this is possible with VBA, but I wouldn't bet on it. It sounds as if either a redesign or a continuation of the manual labor is indicated. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... Many thanks for the suggestion, but it doesn't go far enough! The call-out is indeed in a frame, which is already set to "outside". That takes care of which side of the page the call-out appears. My problem is the text alignment of the paragraph within the frame: right on even pages, left on odd. In the past this has been done manually shortly before printing. I would like to automate it, but cannot see any way of enabling the style to sense whether the call-out is on an odd or even page and switch its horizontal text alignment accordingly. I have even wondered about the possibility of a formula triggering an appropriate macro, possibly tucked away as hidden text in a paragraph number format. But I am basically an overworked translator, not a Word wizard, and do not have unlimited time for experiments of this kind. -- olitrans Technical Translator Germany "Suzanne S. Barnhill" wrote: Assuming the "callout" is a frame, the position of the frame can be set to "Outside." See http://sbarnhill.mvps.org/WordFAQs/MarginalText.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "olitrans" wrote in message ... I am using Word 2003 under Windows XP. I have received a number of long double-page documents for a university course, all of which are surprisingly well and consistently formatted. Most body text paragraphs are accompanied by a short call-out in the outer margin. The call-out style includes "Keep with next" so that it always stays glued to the beginning of the home paragraph, even if the latter changes pages. The formatting also ensures that the call-out stays in the outer margin, i.e. left on even pages, right on odd pages. Problem: The call-out has to be right-aligned on even pages, left-aligned on odd pages, i.e. the flush side of the call-out is always nearest the body text. In the German source text, this has been done manually, which is obviously a nuisance and error-prone. Is there any way of automating the alignment so that the call-out senses whether it is on an even or an odd page and switches the paragraph alignment accordingly? Alternatively, could one easily build a macro that would run through the document applying left and right call-out styles appropriately depending on the page side? -- olitrans Technical Translator Germany |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I get the valid full name, before I call .Documents.Open() method | New Users | |||
Automating data entry in documents | Microsoft Word Help | |||
Page Alignment | Microsoft Word Help | |||
How do I double space my documents? | Microsoft Word Help | |||
Word Page Alignment sideways, and when I type in the page, my text | Microsoft Word Help |