Probably something to do with the new line feed translation from Outlook to Word.
Try using the VBA Replace() function to replace Chr(10) with nothing.
In case it is not a Chr(10), select the space in the address and run
MsgBox Asc(Selection)
and see what numeral it returns. Then use that inside the () of Chr() in the Replace function.
-- Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis.
Doug Robbins - Word MVP
"J.R. Winder" <jwinder[ at ]Daystarinc.com> wrote in message news:%23OvY93uLJHA.3744[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text] > Hi- > > My dev group has developed and addin for Outlook 07 that enables Outlook > 'Contact' > fields to be merged into MS Word 07 templates. The addin works fine > however > Word seems to be including a leading space for the second line in the > Outlook Contact BusinessAddress field. > > This is an example of how the fields are setup in the Word Template: > <FullName> > <CompanyName> > <BusinessAddressStreet> > <BusinessAddressCity>, <BusinessAddressState> <BusinessAddressPostalCode> > > ...and this is an example of how the data looks once the fields are merged > into the Word doc: > John Doe > John Does Landscaping > 55 Main Street > Unit 4 > Portsmouth, NH 03801 > > Through testing we've been able to determin that Outlook is passing the > <BusinessAddressStreet> field to Word properly (no leading space for line > 2), yet for some reason Word includes the leading space for line 2 when > resolving the field data. > > Any thoughts on how to make Word behave so there is no leading space when > an address filed has multiple lines for a street address? > > Thanks > JR >
|