Friday, August 12, 2005

SysAdmins is Hiring...

The Company I work for SysAdmins is currently in the process of hiring new development staff for the new Development Centre in Sri Lanka. If any of you guys are interested in applying please forward your CV with two non-related referees. Given below is the advertisement I extracted from the Sri lankan dotnet developers user group.

"Permanent - Software Engineers required for company in Sri Lanka (WTC office). Several positions available including, senior, junior, support and project management. Microsoft technologies with the following skills:

1. Bachelor's degree in IT or equivalent.
2. Over 1 year of industry experience in Microsoft development technologies. (ASP.NET, C#, VB.NET., ASP, VB. SQL server.)
3. Good understanding of software development .NET in team environment.
4. Sound knowledge in object oriented design and application development.
5. Good knowledge of UML and computer science fundamentals.
6. Very good analytical and problem solving skills.
7. Excellent communication skills.
8. Flexibility in working under changing.
9. MCP prefered.

Salary range 30k to 60k dependant on experience
Fw your CVs to
jobs@sysadmins.co.uk
Country: Sri Lanka Email:
jobs@sysadmins.co.uk "

Monday, August 08, 2005

How to Set Measurement Unit of MS Word Print Dialog Programatically

In a recent project that I'm working for at my current work place, We were using Office Interop for printing some word documents from HTML files and we wanted to set the measurement unit of the page to print (Inches, Millimeters, Centimiters etc...) . We were struggling over this issue for a while; Since the Word API was not so easy to be familiar with. At last I found the way to set it. I give below a sample of the code we came up with. I hope this will someday could be used by many.
N.B: Code is in VB.Net

Public objWord As Word.Application ' Word Application Object

Private Function printHTML(ByVal document As String, ByVal nums As Int32, ByVal orientation As Int32, ByVal leftMargin As Int32, ByVal topMargin As Int32, ByVal rightMargin As Int32, ByVal bottomMargin As Int32, ByVal pageSize As Int32, ByVal printdest As String) As Boolean

Const ForWriting = 2 ' Input OutPut mode
Const Create = True


Dim MyFile As String
Dim FSO As File 'Variable to deal with parameters to the Word Interop that we don't need to pass
Dim NoParam As Object
NoParam = Type.Missing

MyFile = Path & document & ".html" ' HTML File to Print

If FSO.Exists(MyFile) Then
objWord.Documents.Open(MyFile, False, True, NoParam, NoParam, NoParam, NoParam, NoParam, NoParam, NoParam, NoParam, NoParam)

' Setting destination printer
With objWord.Application.Dialogs.Item(Word.WdWordDialog.wdDialogFilePrintSetup)
.Printer = printdest
.DoNotSetAsSysDefault = True
.Execute()
End With


' setting up Page Orientation
If orientation = 2 Then
objWord.ActiveDocument.PageSetup.Orientation = Word.WdOrientation.wdOrientLandscape
Else
objWord.ActiveDocument.PageSetup.Orientation = Word.WdOrientation.wdOrientPortrait
End If


' Setting pages Measurement Unit to Millimeters
With objWord
.Application.Options.MeasurementUnit = Word.WdMeasurementUnits.wdMillimeters
End With


'Setting the Page Size
objWord.ActiveDocument.PageSetup.PaperSize = pageSize

' Setting the Margins
objWord.ActiveDocument.PageSetup.LeftMargin = leftMargin
objWord.ActiveDocument.PageSetup.RightMargin = rightMargin
objWord.ActiveDocument.PageSetup.TopMargin = topMargin
objWord.ActiveDocument.PageSetup.BottomMargin = bottomMargin



objWord.Options.PrintBackground = False 'Do not print the background
'Call the Print method
objWord.ActiveDocument.PrintOut(False, NoParam, NoParam, NoParam, NoParam, NoParam, NoParam, CStr(nums), NoParam, NoParam, NoParam, NoParam, NoParam, NoParam, NoParam, NoParam, NoParam, NoParam)


'Closing the File
objWord.ActiveDocument.Close(False)

' clean up files
If (FSO.Exists(MyFile)) Then FSO.Delete(MyFile)


End Function

The Youngest MCP in Pakistan

Arfa Karim a nine year old girl from pakistan has got her Microsoft Certification recently which makes her one of the under ten year old MCPs in the world (only a few you can find). I wish you all the best Arfa. May all your dreams come true since all of them are really good ones as I can see. Check out more information about Arfa by following the links given below.

Bill Gates to Stay at World's Youngest MCP's Home in Pakistan
Arfa's Trip to Redmond
Interview with Arfa Karim
Youngest MCP in Pakistan