Page 1 of 1 1
Topic Options
#191609 - 2009-01-05 04:44 PM Help with setting outlook Reg_Binary to set fonts
paul28 Offline
Fresh Scripter

Registered: 2008-02-28
Posts: 20
Loc: UK
Here are the hex values but I'm struggling to find how to set these values with kix:

[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\MailSettings]

"ComposeFontSimple"=hex:3c,00,00,00,0f,00,00,e8,00,00,00,40,f0,00,00,00,4e,0d,\
73,74,00,00,00,00,00,20,41,72,69,61,6c,00,00,00,00,00,00,00,00,00,00,00,00,\
00,01,00,00,00,84,ea,13,00,01,00,00,00,01,00,00,00
"ReplyFontSimple"=hex:3c,00,00,00,0f,00,00,e8,00,00,00,00,f0,00,00,00,4e,0d,73,\
74,00,00,ff,00,00,20,41,72,69,61,6c,00,00,00,00,00,00,00,00,00,00,00,00,00,\
01,00,00,00,84,ea,13,00,01,00,00,00,01,00,00,00
"TextFontSimple"=hex:3c,00,00,00,0f,00,00,e8,00,00,00,40,f0,00,00,00,4e,0d,73,\
74,00,00,00,00,00,30,43,6f,75,72,69,65,72,20,4e,65,77,00,00,00,00,00,00,00,\
01,00,00,00,84,ea,13,00,01,00,00,00,01,00,00,00

Any help would be much appreciated.

Top
#191622 - 2009-01-05 09:01 PM Re: Help with setting outlook Reg_Binary to set fonts [Re: paul28]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: CA
I would probably try to read that value with KiX into a variable and see what it looks like and then you normally can just put it back in exactly the same.

Not sure what you're doing but there have also been a couple recent posts about installing Fonts in case you're interested please do a search.

Top
#191666 - 2009-01-06 09:42 AM Re: Help with setting outlook Reg_Binary to set fonts [Re: NTDOC]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Use WriteValue, drop the "hex:" prefix and the commas in the data.

For example:
 Code:
$sKey="HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\MailSettings"
$sNUL=WriteValue($sKey,"ComposeFontSimple",
	"3c0000000f0000e800000040f00000004e0d"
	+"7374000000000020417269616c000000000000000000000000"
	+"000100000084ea13000100000001000000",
	"REG_BINARY")

Top
#191667 - 2009-01-06 09:55 AM Re: Help with setting outlook Reg_Binary to set fonts [Re: Richard H.]
paul28 Offline
Fresh Scripter

Registered: 2008-02-28
Posts: 20
Loc: UK
Sorry I perhaps should have mentioned what the purpose of my request for assistance was. We have beeen asked to set a the font and size to a standard Arial 12 Pt.

I have searched the forums and most if not all messages seem to be about installing new fonts.

Thanks in advance

Top
#191671 - 2009-01-06 03:51 PM Re: Help with setting outlook Reg_Binary to set fonts [Re: paul28]
paul28 Offline
Fresh Scripter

Registered: 2008-02-28
Posts: 20
Loc: UK
Thanks Richard I've now got this working.

This is my fist time with any scripting language and I was wondering if you could give me some assistance with your example.

I tried your example as above but it was failing with an error of $skey not defined. I am reading the manual and it goes on to say the first reference to $GlobalVariable will become global visible I took this to mean that because I'm not using $skey anywhere eles in my script. I would be able to simply copy your example into my script as is. This is what I tried to do and this is where it failed.

If I put the $skey "" at the start of my script it then works. I decided against this approach and instead went for Dim $skey which also worked.

Secondly, what is the purpose of $sNul? I'm confused because there's no reference to this variable so why use?

Thanks

Top
#191672 - 2009-01-06 04:33 PM Re: Help with setting outlook Reg_Binary to set fonts [Re: paul28]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
You probably have Setoption("Explicit", "On") at the top of your script. If you do then you need to use DIM to declare all variables.

The $sNul is used to catch the return code of the writevalue function. You can leave it out but then you will see the return code on the screen.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#191675 - 2009-01-06 09:05 PM Re: Help with setting outlook Reg_Binary to set fonts [Re: Mart]
paul28 Offline
Fresh Scripter

Registered: 2008-02-28
Posts: 20
Loc: UK
Hi Mart,

Yes I do have the Setoption("Explicit","On") but I never really knew why, just followed the best practice advice on the forum. Thanks for the explanation.

OK this $sNul bit, you say it is used to catch the return code. Does it catch the return code in a log file?

Top
#191679 - 2009-01-06 09:17 PM Re: Help with setting outlook Reg_Binary to set fonts [Re: paul28]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: CA
If you tell it to write to a log it can, but in general many are there to suppress output to the screen.

Example:

CODE 1
@Domain ; this will show in a DOS console/box.

CODE 2
$MyDomain = @Domain ; this will not show in a DOS console/box and can be used/referenced elsewhere in your script if needed. Though maybe a bad example on my part because this one is a Macro and a Macro can always be used anywhere in the code.

CODE 3
$SO=SetOption('Explicit','On')
$MyDomain = @Domain ; this will produce an error because you've not declared it.

CODE 4
$SO=SetOption('Explicit','On')
Dim $MyDomain
$MyDomain = @Domain ; this will not produce an error because it has been declared

Top
#191684 - 2009-01-07 09:43 AM Re: Help with setting outlook Reg_Binary to set fonts [Re: paul28]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
 Originally Posted By: paul28
Yes I do have the Setoption("Explicit","On")

Very good \:\)

Keep it on, it will save you a lot of work and head-scratching.

In short scriptlets posted in response to a query you often won't see setup code like SetOption() and variable declaration as it detracts from the purpose of the sample code.

 Originally Posted By: paul28
OK this $sNul bit, you say it is used to catch the return code. Does it catch the return code in a log file?


No.

$sNUL is just a normal variable like any other. I use $sNUL, $sDISCARD, $IGNORE or something similar so that it is both obvious and explicit that I don't intend to do anything with the value. Many times you will see people using the un-named variable "$" to suppress the return value.

As it is a normal variable you can decide what you want to do with it - write it to the console, put in in a log file, display a pop-up message, branch the script code or whatever.

In example scriptlets we suppress the return value. In production you may want to check it for success (also see the @ERROR and @SERROR macros) and perform some sort of action if it has failed.

Top
#191685 - 2009-01-07 09:58 AM Re: Help with setting outlook Reg_Binary to set fonts [Re: paul28]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
 Originally Posted By: paul28
Sorry I perhaps should have mentioned what the purpose of my request for assistance was. We have beeen asked to set a the font and size to a standard Arial 12 Pt.

I have searched the forums and most if not all messages seem to be about installing new fonts.

Thanks in advance

Allen just wrote up a nice new UDF called AddFont() in the UDF section of the forum.

Top
#191686 - 2009-01-07 10:11 AM Re: Help with setting outlook Reg_Binary to set fonts [Re: Arend_]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
 Originally Posted By: apronk
 Originally Posted By: paul28
Sorry I perhaps should have mentioned what the purpose of my request for assistance was. We have beeen asked to set a the font and size to a standard Arial 12 Pt.

I have searched the forums and most if not all messages seem to be about installing new fonts.

Thanks in advance

Allen just wrote up a nice new UDF called AddFont() in the UDF section of the forum.


Yep verry nice UDF but that is not what Paul28 is looking for ;\)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 661 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.06 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org