split

  • Thread starter Thread starter Joel Allen
  • Start date Start date
J

Joel Allen

Hi,

I want to split a field. e.g. I have a field named Contact. The value is
John Smith.

I want to do this:

Item.UserProperties("FirstName").Value = "John" from the Contact field.
Item.UserProperties("LastName").Value = "Smith" from the Contact field.

Thanks,
Joel
 
Am Wed, 14 Dec 2005 04:39:30 GMT schrieb Joel Allen:


Hi,

I want to split a field. e.g. I have a field named Contact. The value is
John Smith.

I want to do this:

Item.UserProperties("FirstName").Value = "John" from the Contact field.
Item.UserProperties("LastName").Value = "Smith" from the Contact field.

Thanks,
Joel

Joel, very comfortable is the Split-Funktion:

Dim v as Variant
v=Split("John Smith", " ")
Firstname=v(0)
LastName=v(1)
 
Thanks.

I get this error "Expected end of statement" on this line:

Dim v as Variant

Here are my global variables:

Option Explicit
Dim m_blnWeOpenedWord
Dim m_blnWordPrintBackground
Const wdDoNotSaveChanges = 0
Dim ins
Dim pgs
Dim pg
Dim ctls
Dim ctl
Dim JobNameNumber
Dim v as Variant
Dim FirstNamee
Dim LastNamee

And here is where I am running the code:

v="Hi There"
FirstNamee=v(0)
LastNamee=v(1)

Item.UserProperties("ContactName").Value = FirstNamee

Thanks for your help,
Joel
 
Am Thu, 15 Dec 2005 09:49:40 -0800 schrieb Joel Allen:

In VBA there´s no reason for that error message, so I assume you´re using
VBScript. If that´s the case just type:

Dim v
 
Back
Top