Wrong result from GetCheckBox.

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Jaylee
Junior Coder
Posts: 45
Joined: Wed Feb 08, 2006 4:48 am

Wrong result from GetCheckBox.

Post by Jaylee » Thu Feb 16, 2006 9:40 am

G'day again,

Using Version 6 with XP and Outlook 2003.

I am trying to get the correct result from a checkbox on the Print screen in Outlook. I only seem to be having problems with one box. I'm using the code from the Help files with my Print window:


GetCheckBox>Print,Print &attached files. Attachments will print to the default printer only.,res
If>res=1,checked,unchecked

Label>checked
Message>The checkbox is checked!
Goto>end

Label>unchecked
Message>The checkbox is not checked!

Label>end


It doesn't matter if this box is checked or not, the code gives me Not Checked every time. I've used it with other checkboxes on the same window:

GetCheckBox>Print,Print to &file,res

GetCheckBox>Print,C&ollate copies,res


Both of these checkboxes work with the GetCheckBox code.

The problem box contains fullstops. Could this be the problem? The letter "a" is definitely the keyboard toggle for this box.

Could someone please tell me where I'm going wrong?

Really appreciate any assistance.

TIA. :D

J.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Feb 16, 2006 2:26 pm

Be sure you have removed all trailing spaces.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 16, 2006 3:29 pm

Are you sure the checkbox caption is "Print &attached files. Attachments will print to the default printer only."? It is possible that it is only part of that and some of that is in an adjacent label. Use Tools/View System Windows to find it and see what the checkbox caption actuall is.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Jaylee
Junior Coder
Posts: 45
Joined: Wed Feb 08, 2006 4:48 am

Post by Jaylee » Fri Feb 17, 2006 7:38 am

Thank you Bob and Marcus for your replies.

I had already checked for trailing spaces but did it again anyway. Still no joy.

I'm running Version 6 so I don't think it has the option for viewing the system windows. At least ... I couldn't find it.

I have tried shortening the caption, removing all spaces, removing spaces after the full stops, getting a screen print and comparing my text letter by letter, and space by space.

If I click on the label, a "highlight" (dotted line) appears all the way around the label which seems to indicate to my highly untrained eye, that the caption is all included in one label.

Any other thoughts, please? Is there another way to view the system windows?

TIA.

J.

Jaylee
Junior Coder
Posts: 45
Joined: Wed Feb 08, 2006 4:48 am

Post by Jaylee » Sat Mar 04, 2006 5:02 am

Hello,

I have now upgraded to Version 8 (HURRAY!!!).

I am still getting the same incorrect result from GetCheckbox for this one checkbox in the Print screen. I used Tools > View System Windows to identify what the true name of this checkbox is. This tool has confirmed the name as 197310 - Button "Print &attached files. Attachments will print to the default printer only."

On the same print screen are two other checkboxes called Print to &file and C&ollate copies. Both of these return the correct result from GetCheckBox.

Any ideas?

Kind regards, :D
J.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Mar 04, 2006 9:16 am

Hi,

I see the problem. You have only one space between the two sentences in that caption. There are two spaces between "files." and "Attachments":

"Print &attached files.^^Attachments will print to the default printer only."

I've substituted the spaces with ^^.

To avoid mistakes like this, use the View System Windows tool. Find the object in the list, right click on it and select Copy Object Caption. Then paste that into the script. That will avoid typos.

So your script snippet should be:

GetCheckBox>Print,Print &attached files. Attachments will print to the default printer only.,res
If>res=1,checked,unchecked
Label>checked
Message>The checkbox is checked!
Goto>end
Label>unchecked
Message>The checkbox is not checked!
Label>end

This would be better:

GetCheckBox>Print,Print &attached files. Attachments will print to the default printer only.,res
If>res=1
MessageModal>The checkbox is checked
Else
If>res=0
MessageModal>The checkbox is not checked
Else
MessageModal>Could not locate checkbox
Endif
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Jaylee
Junior Coder
Posts: 45
Joined: Wed Feb 08, 2006 4:48 am

Post by Jaylee » Sun Mar 05, 2006 5:48 am

Hello Marcus,

Thank you. You were absolutely spot on. I had not realised the option for copying the caption was available but will be making full use of it now.

I am now getting the correct response for this CheckBox.

Kind regards, :D
J.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts