Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can I do this??

    Hi,

    Quick question. In the 'Customize Outline Numbered List' window of Word, there is a preview window which contains a graphic break down of how Headings 1-9 will appear in the document. It is a clickable window which updates dynamically to reflect changes made to the properties.

    I am creating a custom application which needs to contain similar functionality.

    How on earth do I create something similar whereby if a user enters 'abcde' into the 'Heading 1' text box, the same text will dynamically apear in the graphic??

    I have spent ages looking into this and it seems impossible to do.

    Any feedback on how to do this would be much appreciated.

    The attached image displays an example of the preview window.

    Thanks, Chris
    Attached Images Attached Images

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How can I do this??

    Well, I'm not sure I understand 'zactly what you're up to, but here's a snippet that
    puts the text typed into a textbox into another text box while the user types:

    Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
    TextBox2.Text = TextBox1.Text
    End Sub


    Is that sorta like what you're after?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How can I do this??

    Wouldn't the Change event be a better event to use?
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How can I do this??

    Yes it would. Much better.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How can I do this??

    Hi guys,

    I think something involving the Change event is the way to go, however, I am still at a complete loss as to how Word manages to change the actual image depending on what the user types. Take a look at the attached image. Before user text is added the preview window contains a graph of Headings 1-9. As the user enters text, what was 'Heading 1------------------' dynamically changes as the user enters text and finally becomes 'USER TXT 1. Heading 1 ---'. I hope this makes sense.

    Kevin, your suggestion is kind of what I'm after, but I need to replicate Word's native functionality.

    If you have a spare moment, take a look at the preview window I am referring to in Word:

    Format | Bullets and Numbering | Outline Numbered | (Select a scheme) Customize

    Try entering text into the 'Number format' text box. See how the preview window changes dynamically? You are also able to click on any of the Headings 1-9. Let me know what you think.

    Thanks for your time chaps. It is much appreciated [img]/forums/images/smilies/smile.gif[/img]

    Chris
    Attached Images Attached Images

  6. #6
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How can I do this??

    The preview window is just a multiline textbox that is updated on the change event of the Number Format textbox. You will have to keep the contents of the preview window in an array of strings, then at the change event, update the appropriate item in the preview array, and finally replace the contents of the Preview window with the preview array. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  7. #7
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How can I do this??

    Thanks Sam, I'll look into that.

    Out of interest, if it is a multiline textbox, how is the image dynamically altered as the user types in text?

    The 'Heading 1 --------------------' thick black line gradually gets smaller as more text is entered. It looks like the '--------------' part is some sort of image.

    Also, will a multiline textbox allow the user to click on any of the 9 lines to go directly to that heading?

    Thanks, Chris

  8. #8
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How can I do this??

    Depending on how close you want the Preview to match the existing Dialog box, you will have some real problems. To match exactly, you will have to make it a rich textbox, because the fonts, etc. are not the same throughout, and you will have to compute which line the user click on. Looks very ugly! --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  9. #9
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How can I do this??

    Well, if possible, I need to match the graphic preview window as closely as possible. Is this doable?

    If not, can anybody suggest an alternative as to how to replicate the graphic preview window?

    Thanks, Chris

  10. #10
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How can I do this??

    Why don't you explain exactly what you're trying to do and *why*. Just saying it's necessary, doesn't really explain anything. Does someone have a sword held over your head on this?
    Charlotte

  11. #11
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How can I do this??

    Apologies for the rather vague post Charlotte.

    Basically, what I am developing is an application which enables users to create a custom outline numbered list using a user form (of my own creation) instead of having to use Word's native tools.

    Presently, to make any changes to a numbered list, they have to use the native 'Customize Outline Numbered List' window ---->

    Format | Bullets and Numbering | Outline Numbered (tab) | Customize

    99% of my users are finding using this native window is a nightmare and would love some sort of tool which would allow them to create Numbered Lists from scratch. This is what I am trying to develop [img]/forums/images/smilies/smile.gif[/img]

    So basically, what I have at the moment, is a user form containing a whole bunch of text boxes, list menus etc...which replicate the 'Customize Outline Numbered List' window. However, instead of the native word headings such as 'Number format', 'Number style', 'Previous level number; etc... I have used more 'user-friendly' terms.

    The problem I am having, however, is how to implement the graphic preview window (featured in the Word 'Customize Outline Numbered List' window) into my custom user form. Without it, the custom user form is pointless and the user won't be able to preview their changes on the fly (as they currently can in the native Word window).

    I hope that makes a bit more sense [img]/forums/images/smilies/smile.gif[/img]

    And yes, this is urgent...

    Thanks, Chris

  12. #12
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Eugene, Oregon, USA
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How can I do this??

    I actually did a project in which I replicated the preview pane. I used a frame. To draw the lines, I believe I used image controls that were very thin, used borders and did not contain any actual images. I moved the image controls on the frame to show indent behavior, etc. I then put the text in the upper layers of the frame (I think I might of used the auto-size method to resize the text controls to fit the actual text that they contained). in this way, as the text got longer, the text would lay on top of the image control (appearing to "shrink" the control).

    Hope this helps!

  13. #13
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How can I do this??

    Hi Hubert,

    Thanks so much for the feedback.

    This thing has been driving me insane for the past 3 days (and nights!). I will certainly try what you suggested.

    Out of interest, do you have any other info/feedback you can give me on how to do this?

    The use of image controls sounds fascinating, however, when you mention moving the image controls to show indent behavior, do you mean you just resized the image control, or did you actually move it's position within the frame?

    Also, how did you implement the auto-size method of the text control? This is something I haven't used before.

    Thanks again [img]/forums/images/smilies/smile.gif[/img]

    Chris

  14. #14
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Eugene, Oregon, USA
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How can I do this??

    regarding autosize--it's a property, not a method as i originally mentioned. but here's my methodology:
    1. set txt.autosize = false
    2. changed the txt.caption property to contain the changed text
    3. changed the txt.width property to the maximum size to fit inside the fram
    4. changed txt.autosize = true (this resizes the txtbox)
    5. changed the txt.height value to show me only one line (in case the text.caption wraps to the next line--this truncates the text instead of allowing it to expand down)

    [steps 1-3 are necessary to prevent the auto-size attribute from expanding the text size vertically instead of horizontally.]


    with respect to moving the image controls (as well as the text controls) to match indentation levels--i both moved them (set the Ctrl.left property) and resized them (Ctrl.width = Frame.width - Ctrl.Left) (make sure to handle the logical and syntax error if Ctrl.Left > Frame.width).

    [one other point--the built-in preview functionality in Word changes the selected list level to take up two lines in the preview pane while all other list levels take up one line in the preview pane; in my preview pane, i created two lines for every list level in the preview pane to avoiding having to move (vertically) all the controls in the frame every time a different list level was selected.]

    [lastly, perhaps, i should offer a word of caution. when i did this, i created an alternate interface to handle paragraph numbering which caused me many many more then 3 days and nights of pulling my hair out and, even at this point, i can't say that my hair-pulling days are over. the complexity of implementing and reading/interpreting existing outlines and taking care of all the attributes of list templates, paragraph styles, font formatting, etc. also leads to some pretty exhausting days debugging. are you sure that none of the third-party numbering applications could meet your needs?]

  15. #15
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How can I do this??

    <hr>caused me many ... days and nights of pulling my hair out<hr>
    <img src=/S/yep.gif border=0 alt=yep width=15 height=15> <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15> and just to help out some stupid user who needs to learn how to really use Word <img src=/S/exclamation.gif border=0 alt=exclamation width=15 height=15> <img src=/S/wink.gif border=0 alt=wink width=15 height=15>
    -- Sam (been there, got the tee shirt, but no one said thank-you!)
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •