Tampilkan postingan dengan label computer. Tampilkan semua postingan
Tampilkan postingan dengan label computer. Tampilkan semua postingan

Rabu, 08 Oktober 2008

Creating an Automatic Saving Program in New Document of Microsoft Word

Creating a new document is an activity simply. But we sometime forget to saving it. So this article helps us to saving the document automatically.

When you click File New or Ctrl+N the dialog will seen like :


After it you give a file name, for example Fitri:



Like last article, We use Visual Basic Editor fasility. Follow the steps behind:
You click Tools => Macro => Visual Basic Editor or enter keyboard together (ALT+F10) so will dialog visual basic editor. After that step is done, then right click project


then copy this code into place of source code:
------------------

'Tips dan Trik Visual Basic Editor
'CopyLeft by Sutrisno
'http://trisnowlaharwetan.net

Sub AddName()
On Error Resume Next
Dim NamaFile
NamaFile = InputBox("Enter File Name", "Trisno's Project")
If NamaFile = "" Then Exit Sub
Documents.Add
ActiveDocument.SaveAs FileName:=NamaFile
End Sub

Sub FileNew()
Call AddName
End Sub

------------------

Good luck...

Senin, 29 September 2008

Making Password when Printing in Microsoft Word

Printing is a simple activity in Microsoft Word. Everyone can do it. We alcoways do it, File => Print or we enter keyboard together with Ctrl+P. We can look the dialog print like the picture.

The problem, Can we print document with security? Like a password when we print document?

Microsoft word can't do it. There aren't tools to do it. So we must configure it with Visual Basic Editor (VBE). It is a adding tools in Microsoft Word with Basic Language. If we are familiar with Basic, so we will be easy to create in VBE Microsoft Word.

In this article, we will make a program (source code), when we click File Print (Ctrl + P) the dialog like it :
So when we input the password true (password ='Sutrisno'), like :
whe the password is wrong (example we write 'zdx'), the dialogs will like :
The ask is how make it. It is very easy to do. You click Tools => Macro => Visual Basic Editor or enter keyboard together (ALT+F10) so will dialog visual basic editor. After that step is done, then right click project normal. So copy or write this coding in t
the project.

'-------------------------------------

Sub FilePrint()

Dim txtPass

Dim txtMasuk

txtMasuk = "Sutrisno"

txtPass = InputBox("Input the Password", "Security Options")

If txtPass = "" Then Exit Sub

If txtPass = txtMasuk Then

Dialogs(wdDialogFilePrint).Show

Else

MsgBox "Wrong Password", vbCritical, "Confirmation !!!"

End If

End Sub

-------------------------------------


After copying or writing the source code above, we will look the dialogs like the picture behind. And don't forget, click File =>Save to save this session. This article is too publishing in Indonesian Edition. Thanks.. And Good Luck




























 
Indonesian Edition