You don't need an API to get screen resolution. You can use ...
System.HorizontalResolution and
System.VerticalResolution
You don't need an API to get screen resolution. You can use ...
System.HorizontalResolution and
System.VerticalResolution
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
I like the idea of using a fraction of the screen though - I never thought of that
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
If you want the "tall" toolbar, as per Tony's example, add MyBar.Width = 40 as the last line in the macro, otherwise it gets reset when buttons are added
Having opened some of my UserForms on an 800 x 600 display, I knew I had to find a flexible solution!
Incidentally, toolbar settings are user-level, held in the registry - you can't control their location by template, except by using code to position them at document new or document open.
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
That's when we're implementing the toolbars, Tony.
I don't know how to change MD's code to *not* be an API call though.
~Anne Troy
I never noticed your previous post Tony; I must look into these System items, I searched the help for ages to find the API method. I would go with Tony's Version and delete the API
[VBA]
With Mybar
.Top = System.VerticalResolution * 0.3
.Left = System.HorizontalResolution * 0.3
End With
[/VBA]
Sweet. 0.2 was perfect
~Anne Troy
Interested to see the "final product"! Will you email me a copy please.
MD
Grits 'n Sals
I must admit that when I began my project the traditional Toolbar was easier for me than to learn than creating commandbars in code. But I was just wondering if their was an advantage of creating them in code, given that mine a templates operating in Word as distinct from a VB program using Application.Word
I just know that when they're NOT built using code, people complain "the toolbar doesn't go with the template" and "the toolbar is left after I close the doc" and stuff like that. I have just always understood that building toolbars in code is much more stable.
MD, I didn't see your post before, sorry. Sending.
~Anne Troy
Looks good DB!