Posts by Madeleinenorway

    Re: Make styles in tv-script visible by userform


    Just one thing: I dont dare to touch your code without asking you - afraid of messing it all up. The userform1 is to small to show all my styles - how do I expand it? Another thing - rename it to "Velg stiler" (means "Show styles"). Proposal for upcoming feature; being able to apply style to the document via the UserForm1 - like a dashboard :). Thank you so much, mister.

    :) :) :)

    Re: Make styles in tv-script visible by userform


    :music:Ha ha. This really works. I am looking forward to the day I got vba skills like this. I have just copied all my styles into An Opus (:)) - and it is just so cool to switch information on and off. You should have seen my script (20 pages, packed with info - prepared for one day of shooting). Your code even handle the toc: I can make it shorter or expand it just with a click. Fantastic!!! I am so grateful. How do I make this an add-in. by the way?

    Re: Urgent: Make styles in tv-script visible by userform


    Yes :) :). Thank you so much for spending your time on this. Meanwhile - is there a way to retrieve the name of the checkbox clicked - and put that in a variable - so for each style - i do not have to write every style, and every checkbox. Something like this? (I have tried, but get an error message - that this method is not supported)

    Code
    Private Sub chkSequence_Click()
    Dim [B]name[/B] as string
    [B]name[/B] = Me.Controls.MsoCheckBox.name
     
    If [B]name[/B].Value = False Then
    ActiveDocument.Styles("[B]name[/B]").Font.Hidden = True
    Else
    ActiveDocument.Styles("[B]name[/B]").Font.Hidden = False
    End If
    End Sub



    Thank you anyway :).

    Cheers,
    M

    Re: Urgent: Make styles in tv-script visible by userform


    Hi agian Cytop,
    Your code is absolutely brilliant. The form opens when I open the document. If you got time - I have two more question;

    1) In the subs for each of the checkbox click events - is it possible to simplfy the code more, i mean in stead of writing each name of the style, and each name of the control, is it possible to pull out the name of the control clicked, save it in a variable and use that variable instead? Would be much more easy to add or substract style "boxes" then.

    2) Add checkbox that makes "reports"? For example: If I add a checkbox called "Photographer" - the document selected choice of styles at once, like Heading1, Sceneheading, Synopsis and Photographer? And when turning off that chech box - the state of the UserForm returns to what was previously selected

    If you got time, I would be very grateful. Anyway - I am very happy for your help so far :)

    M

    Re: Urgent: Make styles in tv-script visible by userform


    Off couse. I have to do it my self. Thank you so much for your help. If you have the time and will - you can help me tomorrow. But you allready done a lot. But maybe I will have some questions tomorrow. I will try to post you, but if you dont have the time, thank you anyway :) :) :). You tracked me in the right direction here :)

    Re: Urgent: Make styles in tv-script visible by userform


    I think I am getting there :) Awsome. I am Norwegian - so the name "Title" is "Tittel" in Norwegian. In your code you disable styles that are not in the document? I tried adding "Title" as a style - and all of the sudden - the "Title"-checkbox was enabled. I checked it - and the style disappeared. Do you know how to show all/hide all? And reflect the changes in the userform? If you got time. Thank you, anyway. :):)

    Re: Urgent: Make styles in tv-script visible by userform


    I tried to open it, but the form did not load. I ran the form from vba - but everything is disabled (as you mentioned). I think this really is what I am trying to achieve. But why does the UserForm not load on open? And how do I enable the check-boxes? Sorry for the hazzle. Thank you, anyway.

    Re: Urgent: Make styles in tv-script visible by userform


    Yes, I think that is correct. I have a document - formatted with like 7-10 different styles. From Sequence, Sceneheading, Synopsis, Action, Character, Dialogue, Photographer, Scenographer and so on. I would like to have a UserForm which is based on this styles which I have createded (some of them due to factory standards) - and then - by enable or disable checkboxes - I can hide/unhide the custom styles. And by doing this, building specific reports to the crew-members that need just that kind of information (in other words - hiding information that is not interesting for other crew-members). Thank you for taking your time. :)

    Hi there,
    Is there an easy way in vba (word 2010) to detect the used styles in a document and add them as check boxes on a userform, where I can hide/show the styles by toggle check box status? And automatically add another check box, named "All visible" that shows/hide all? (Except from two pre-defined styles). And - if all the styles are present - the "All visible" check box turns on? And vice versa?
    The reason I ask, is that I am a writer/producer - and when going into production I write notes that aren´t interesting for the whole crew.
    I kind of achieved this through an endless, stupid and not bug-free code. (Sometimes I have to check the boxes all over again, even if I have pressed the "All visible"-checkbox)
    I think there might be a "each/next"-statement that could do the trick - but I am a newbee. Are there someone out there who could help me write a more efficient code that:
    1 ) scans the used styles in the document
    2 ) pass them to a userform (whith names )
    3) when checkbox is pressed - the dependent style is toggles its visible/not visible status?
    The styles I uses now are:

    • TOC
    • Heading
    • Sequence
    • Synopsis
    • Sceneheading (numbered) (Should always be visible)
    • Action
    • Technichians
    • Scenography
    • Administration
    • Character/Dialogue (which is actually two different styles - but they have to show up at the same time)


    Maybe with the ability to change styles easy - and fire the same code?
    Thank you so much in advance.
    Best,
    Madeleine [:)]
    A little snippet of code from my UserForm ("Visalle" means "Show all")