.EndKey Unit:=wdLine
.Font.Bold = False
.TypeText strShipName
.TypeParagraph
Indent the left margin to match the tab setting, so the address will line up with the name:
.ParagraphFormat.TabIndent (1)
.TypeText strShipAddress
.TypeParagraph
.TypeText strShipCityStatePC
.TypeParagraph
.TypeText strShipCountry
.TypeParagraph
Return to the normal left margin before printing the extra information:
.ParagraphFormat.LeftIndent = 8
.TypeParagraph
.Font.Size = 10
.Font.Bold = True
.TypeText “Order ID:” & vbTab _
& CStr(lngOrderID)
.TypeParagraph
.TypeText “Category:” & vbTab _
& strCategory
.TypeParagraph
.TypeText “Product: “ & vbTab & “ID “ _
& lngProductID & “ (“ _
& strProductName & “)”
.TypeParagraph
.TypeText “Supplier:” & vbTab _
& strSupplier
.TypeParagraph
.TypeText “Ship date:” & vbTab _
& strShipDate
.TypeParagraph
.Font.Size = 12
.Font.Bold = False
.TypeParagraph
.TypeText vbTab & “Case “ _
& lngCaseNo & “ of “ & lngNoCases
.MoveRight Unit:=wdCell
End With
Next lngCaseNo
Save the Word labels document for this set of labels:
strSaveName = “Shipping Labels for Order ID “ _
& lngOrderID & “ (“ & strProductName _
& “) shipped on “ & strShipDate & “.doc”
Part II Writing VBA Code to Exchange Data between Office Components