Microsoft Office Tutorials and References
In Depth Information
Creating Word Labels from an Excel Recipient List
'If this section has been reached by error¶
'The Word application should be quit¶
'it is not visible yet.¶
'otherwise there will be an invisible Word session¶
'listed in Task Manager¶
If Not objApp Is Nothing Then¶
objApp.Quit False¶
End If¶
End If¶
End Sub¶
' * * * * *¶
Private Sub UpdateProgressBar(strStatus As String, _¶
currWidth As Single)¶
With Me¶
'Increase progress bar width¶
.lblProgressBar.Width = currWidth¶
'Change caption of progress bar¶
.lblProgressBar.Caption = Format(currWidth / _¶
.fraProgressBack.Width, "0%")¶
'Change status text if it is requested¶
If Not strStatus = "" Then¶
.lblStatus.Caption = strStatus¶
End If¶
End With¶
End Sub¶
' * * * * *¶
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)¶
blnUserCancel = True¶
End Sub¶
Place the first section of code in a standard module of the Excel spreadsheet
that has the label information and the second section of code in the form
module of the ‘frmMain’.
Note: This sample requires a reference to the Microsoft Word Object Library to be
set (because early binding is used). If Office has been custom-installed, this
may need to be set in the Visual Basic Editor under Tools | References |
Microsoft Word x.x Object Library.
Search JabSto ::

Custom Search