I’m trying to code a find & replace that will replace all instances of [customer contact] in my document with specific customer information contained in variables in my code. My problem is that all lines after the first one are appearing with an extra space at the beginning. Here’s my code:
‘ the following code builds a string (strFullContactInfo) containing the complete contact information
With gCustInfo
strFullContactInfo = .ContactFirstName & ” ” & .ContactLastName & vbCrLf & .CustomerCompany & vbCrLf & .ContactAddress
End With
‘ the following code does the find & replace
With ActiveDocument
.Content.Find.Execute “[customer contact]”, False, True, False, False, False, True, wdFindContinue, False, strFullContactInfo, wdReplaceAll, False, False, False, False
End With
Can anyone help me remove these extra spaces.
thanks!
Taibe