Yes, it will. Which was my point that it CAN be done, but I am still confused as to design and purpose.
1. "Or when a certain paragraph style is exited using tab or enter, the following style is dictated by the manner the user exited the last style. Press enter, style one. Press Tab, style two."
Pray tell...how are you going to do that? You would have to have something constantly running in the background. and what, I am dying to know, and I am serious...I really want to know - how are you determining an "exit". You are going to monitor key presses? So if the Enter key is pressed - Do This, and if the Tab key is pressed - Do That?
What if they just need a tab? As Tony asked - how are you going to trigger the display?
2. "Entering a style would happen in the event that the style were already created for a certain paragraph and a user happens to place focus within it. " How are you getting your code to recognize "focus" to ANY paragraph?
Again, I suppose you could have a running piece of code that constantly checks whatever style the Selection point is in. But it would have to be constantly running.
"in the event that the style were already created for a certain paragraph". Interesting statement. It is literally impossible to have a paragraph WITHOUT a style. Every paragraph has a style.
I am not trying to be difficult. I like to learn things, and I am very interested in design. Could you elaborate on what you are doing? I really want to know.
Regarding The information above vis-a-vis the starting location:
1. yes, you can make the UserForm start up anywhere you like.
2. yes, you can use Selection.Information to get the location of the Selection.
3. That information does NOT take into account the menubars (do you have three lines of menus, two?, one?) as the information is all relative to either the page, or the text.
Code:
Sub UserForm_Initialize()
UserForm1.Left = _
Selection.Information(wdHorizontalPositionRelativeToPage)
UserForm1.Top = _
Selection.Information(wdHorizontalPositionRelativeToPage) + 100
End Sub
The UserForm is SystemModal = False, StartUpPosition is manual. I added 100 to bring the form below the Selection point. However, depending on how you have the document displayed, you get unruly results.
Again, please let me know what it is you are doing. I am quite curious.
Gerry
See my
Paintings and Sculpture