Skip to main content

Membuat Borang Dengan Nombor Siri Yang Berturutan Menggunakan MS WORDS 2007

This is a cut and paste article from http://wordribbon.tips.net/T009540_Using_Sequential_Document_Serial_Numbers.html


Using Sequential Document Serial Numbers
by Allen Wyatt (last updated November 20, 2010)

If you have a need to create serial numbers in your documents and they are very simple in nature, you can do so using a macro. This approach to serial numbers is great if your serial numbers are sequential (1, 2, 3, etc.) or regular in their incidence (3, 5, 7, etc.).

To begin, you should enter the macro that will control the change of the serial number and the printing of your document. You can use the following macro:

Sub MySerial()
Dim rngSerialLocation As Range
Dim intSerialNum As Integer
Dim strSerialNum As String
Dim docCurrent As Document
Dim intNumCopies As Integer
Dim intCount As Integer

' set ref to current active doc
Set docCurrent = Application.ActiveDocument
' set ref to the bookmarked serial number
Set rngSerialLocation = docCurrent.Bookmarks("Serial").Range

' get the starting number
intSerialNum = Val(rngSerialLocation.Text)
' get the number of copies required
intNumCopies = Val(InputBox$("How many Copies?", _
"Print Serialized", "1"))

For intCount = 1 To intNumCopies
' print the document
docCurrent.PrintOut Range:=wdPrintAllDocument
' increment the serial number
intSerialNum = intSerialNum + 1
' put into formatted version
strSerialNum = Format(intSerialNum, "00000")
' stuff into proper place
rngSerialLocation.Text = strSerialNum
Next intCount

' reset the bookmark, since the updating procedure
' wipes out the old one
docCurrent.Bookmarks.Add Name:="Serial", _
Range:=rngSerialLocation
End Sub
There is only one prerequisite to using the macro: you need to make sure that your document contains a bookmark named Serial. This bookmark should reference the serial number in your document, as you want it to appear in the first printed document. (When you are through running the macro, you can save the document and the serial number will be ready for the next time you want to use it.)

The macro also assumes that your serial number consists primarily of some numeric value that changes with each iteration. You can modify the incrementing of the serial number, as well as its formatting, in the For...Next loop within the macro.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9540) applies to MS Word versions: 2007 | 2010


Credit to original author.

Comments

Popular posts from this blog

Jalan Jalan di Cherating

P etang Jumaat yang lalu, akudan kroni kroni pejabat telah berjalan - jalan di Cherating. Seperti biasa acara acara seperti ini memang akan dilakukan setahun 2 kali oleh kroni - kroni ini. Tahun lepas ke genting dan ke Port Dickson. Tapi yang aku pasti, sesen pun aku tak keluarkan utnuk perbelanjaan inui kecuali duit Rokok, Tol dan Petrol sahaja. Aku, Tahir, anak Tahir, dan Fareez bertolak awal dengan rancangan untuk memancing di sana sampai muntah. Tapi malangnya Fareez tak berminat memancing... namun atas dasar kroni, dia terpaksa pergi awal juga sebab ini sahaja team bujang yang tinggal. Mujurlah hj. Sazul tetiba pon ada plan nak pergi awal, maka dapatlah book satu bilik awal untuk Fareez. Kami bertolak daripada PJ kira kira pukul 6.30Ptg atas janji bertolak pukul 5 petang. Dalam perjalanan Fareez buleh pula bertekak dengan girlpren dia dan suruh kitorang semua senyap.. aku rasa panas je... lagi sikit aku nak suruh dia berenti dan turunkan aku sebab awek punya pasal kawan kawan pon...

Snooker Tips & Tricks

The stance is the foundation of a players overall playing. A stable and comfortable stance is required when playing to ensure that there is no tendency for the player’s body to move during the shot plus to give a player a good position for aiming at a ball Most people I encounter used a horse-like stance both knees bent with both feet pointing forward which makes(sometimes not) their playing awkward. Using a certain stance will depend on an individual(it’s usually the height). Anyway, for right handed players , the right leg should be in line with the target point of the player . I would recommend the right leg being straight but if the player is tall the leg can be bent. The left leg should be a shoulder width away from the right, it can either be parallel or slightly in front of the right foot. Make sure the left leg is not placed behind the right foot as that can make your body liable to move when taking a shot.