How do i play some code, after section 2 for example?
How do i play some code, after section 2 for example?
Hi,
What do you mean by "section 2" ?
Regards
Steve
And what do you mean by 'play some code'?
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
In word, you can create 'sections' which can break the page up, microsoft recognises what section you are in, i want to know how i can find this out so i can 'play some code' after i have found out what section i am in.
OR i just want to do some VBA for every section, BUT section 1, and "play some code" is self explanatory, i want it to play some code in section 2
It is still far from clear what you want to do - you refer to both "VBA for every section" and "play some code in section 2". Previously, you said you wanted to "play some code, after section 2 for example". Which is it?
You might think '"play some code" is self explanatory', but in 12 years or so of providing help on forums, this is the first time I've encountered the expression. I suspect you mean you want to run a macro, but you've not said so; for all I know you want to run a macro that can be found in Section 2 or to play a video file or sound file embedded in Section 2 ...
You can get the selection's Section # with code like:
MsgBox Selection.Sections(1).Index
That is almost what i wanted, but how do i get the code (just ANY vba, i really don't think it makes a difference what the code is) lets just say
pictureformat as inline shape
for each pictureformat in .section(2 to 20)
with pictureformat
converttoshape
.formatpicture.textbox.type = wdTextboxCentered
end with
next pictureformat
end sub
It really isn't clear what you want to do. If you said what that is instead of using obscure terminology and ambiguous pseudo-code, more progress might be made. It seems you want to:
1) convert every inline shape in sections 2 onwards to shapes; and
2) convert the converted shapes to centred textboxes
The first is possible, but the second is not. You can, however, add a textframe to any shape object.
In any event, if you have in-line textboxes in that range, it's only their wrap format that needs changing as (despite appearances to the contrary) they're not inline shapes. For example, the following code will change the wrap format and alignment of all in-line textboxes in Sections 2 onwards:
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks