OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Macro to Show or Hide Defined Sections [SOLVED]

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
jarthurmiller
General User
General User


Joined: 27 Aug 2003
Posts: 25
Location: Missouri

PostPosted: Wed Jun 13, 2007 2:11 pm    Post subject: Macro to Show or Hide Defined Sections [SOLVED] Reply with quote

I am working on my resume and have defined sections for my experiences. For example, if an employer is looking for someone with commercial lending experience (I'm a lawyer, by the way, but please don't hold that against me), I have a section that goes into great detail about my commercial lending experience. I have a much abbreviated section if commercial lending experience isn't expected by the employer. I will probably have 7-10 sections with detailed lists versus summaries depending on what the employer is looking for.

I know I can go to the Navigator and change the sections manually, but I wonder if one of you experts could provide a macro that would search the document, come up with a list of section names, and allow me to check or uncheck whether the section is to be hidden from a single dialog without having to open each section individually in the Navigator.

Any help you can provide will be much appreciated!

Thanks,

MoJohn


Last edited by jarthurmiller on Mon Jun 18, 2007 9:09 am; edited 1 time in total
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Thu Jun 14, 2007 6:22 am    Post subject: Reply with quote

You don't need a macro for this.

Insert a frame at the beginning or end of your doc and on its Options tab make it nonprinting. In this frame insert a User Field (Ctrl+F2 > Variable tab) with its Format set to Text and a name like "LendingLong". Set its value to "L" (without quotes).

Insert 2 sections for lending (long and short). Using the Navigator right click your sections and Edit. Check Hide and in the Condition box for the long section type LendingLong NEQ "L" (with quotes) and for the short section type LendingLong EQ "L".

When you exit the Navigator only the long section should show. Double click on your variable field and set its value to something other than "L" and only your short section should show. BTW, in this situation "L" is case sensitive.

You can save the doc as a template and have it query you for the value of your User Field(s) with a sightly different use of your field(s).
http://www.oooforum.org/forum/viewtopic.phtml?t=44770&highlight=user+input+field
Back to top
View user's profile Send private message
jarthurmiller
General User
General User


Joined: 27 Aug 2003
Posts: 25
Location: Missouri

PostPosted: Thu Jun 14, 2007 6:40 am    Post subject: Reply with quote

JohnV, since I'm going to have multiple sections with short and long versions, will this work if I put variables for all of them in the same non-printing frame?

Thanks, MoJohn
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Thu Jun 14, 2007 8:14 am    Post subject: Reply with quote

Yes, each section set can be controlled by a different variable and the frame can hold all the variables.
Back to top
View user's profile Send private message
jarthurmiller
General User
General User


Joined: 27 Aug 2003
Posts: 25
Location: Missouri

PostPosted: Sat Jun 16, 2007 9:39 am    Post subject: Reply with quote

JohnV, I believe I followed your instructions "to the T", but when I saved my resume as a template, and used it to create a new document, I received no "prompts" to change the values of the fields to show or hide sections. Other than save my original resume document as a template, what do I need to do to assure that a dialog comes up to prompt me to show or hide relevant sections?

Thanks, MoJohn
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Sat Jun 16, 2007 9:29 pm    Post subject: Reply with quote

Your defined, but not inserted, User Fields must be inserted as Input Fields. See the link I provided above about how to do this but basically you define a User Field by clicking the green check mark instead of Insert and then select Input Field and then Insert.

Still see the link as I may provide more info there. It takes some trial and error to understand how it works.


Last edited by JohnV on Sun Jun 17, 2007 7:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
jarthurmiller
General User
General User


Joined: 27 Aug 2003
Posts: 25
Location: Missouri

PostPosted: Sun Jun 17, 2007 10:57 am    Post subject: Reply with quote

JohnV, I followed your instructions in the link you posed previously, and things work as they should.

Thank you so much for the assist!

MoJohn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group