Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
PromisedOyster PromisedOyster is offline
external usenet poster
 
Posts: 4
Default MAILMERGE IF condition - long text strings

I get the error message: String is longer than 255 characters if I
execute the following code AND the length of oTrueText is greater than
255 characters.

Word.MailMergeField condition =
_wordDoc.MailMerge.Fields.AddIf(_wordApp.Selection .Range
,fieldName
,wdComparison
,ref oCompareTo
,ref oMissing
,ref oTrueText
,ref oMissing
,ref oFalseText
);

Is there any way around this?

I want to create an IF condition with quite long text strings

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default MAILMERGE IF condition - long text strings

Use an IncludeText field in place of the oTrueText and have the string in
the file that is referred to in the IncludeText Field.

--
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

"PromisedOyster" wrote in message
oups.com...
I get the error message: String is longer than 255 characters if I
execute the following code AND the length of oTrueText is greater than
255 characters.

Word.MailMergeField condition =
_wordDoc.MailMerge.Fields.AddIf(_wordApp.Selection .Range
,fieldName
,wdComparison
,ref oCompareTo
,ref oMissing
,ref oTrueText
,ref oMissing
,ref oFalseText
);

Is there any way around this?

I want to create an IF condition with quite long text strings



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default MAILMERGE IF condition - long text strings

Hi Doug (and PromisedOyster),

Inserting an INCLUDETEXT field via the Addif method doesn't work. Mainly
because inserting the INCLUDETEXT field in code requires the insertion range
to be available and, until the Addif process is complete, the target range
doesn't exist. The workaround is to insert a 'token' of some sort (eg the
string 'oTrueText') where the TRUE condition goes, then replace that 'token'
after the Addif process has completed. Whilst you could then put the
INCLUDETEXT field in that spot, you might find it's equally possible to
replace it with the contents of oTrueText explicitly.

Cheers

--
macropod
[MVP - Microsoft Word]


"Doug Robbins - Word MVP" wrote in message
...
Use an IncludeText field in place of the oTrueText and have the string in
the file that is referred to in the IncludeText Field.

--
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

"PromisedOyster" wrote in message
oups.com...
I get the error message: String is longer than 255 characters if I
execute the following code AND the length of oTrueText is greater than
255 characters.

Word.MailMergeField condition =
_wordDoc.MailMerge.Fields.AddIf(_wordApp.Selection .Range
,fieldName
,wdComparison
,ref oCompareTo
,ref oMissing
,ref oTrueText
,ref oMissing
,ref oFalseText
);

Is there any way around this?

I want to create an IF condition with quite long text strings





  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default MAILMERGE IF condition - long text strings

I would never use code to create a mailmerge main document.

--
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

"macropod" wrote in message
...
Hi Doug (and PromisedOyster),

Inserting an INCLUDETEXT field via the Addif method doesn't work. Mainly
because inserting the INCLUDETEXT field in code requires the insertion
range
to be available and, until the Addif process is complete, the target range
doesn't exist. The workaround is to insert a 'token' of some sort (eg the
string 'oTrueText') where the TRUE condition goes, then replace that
'token'
after the Addif process has completed. Whilst you could then put the
INCLUDETEXT field in that spot, you might find it's equally possible to
replace it with the contents of oTrueText explicitly.

Cheers

--
macropod
[MVP - Microsoft Word]


"Doug Robbins - Word MVP" wrote in message
...
Use an IncludeText field in place of the oTrueText and have the string in
the file that is referred to in the IncludeText Field.

--
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

"PromisedOyster" wrote in message
oups.com...
I get the error message: String is longer than 255 characters if I
execute the following code AND the length of oTrueText is greater than
255 characters.

Word.MailMergeField condition =
_wordDoc.MailMerge.Fields.AddIf(_wordApp.Selection .Range
,fieldName
,wdComparison
,ref oCompareTo
,ref oMissing
,ref oTrueText
,ref oMissing
,ref oFalseText
);

Is there any way around this?

I want to create an IF condition with quite long text strings







Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Header with picture or text box Scott Page Layout 15 April 28th 23 02:52 AM
autoshape text wrapping cayce Page Layout 6 June 16th 06 09:42 PM
Hidden text won't stick Gary Burton Formatting Long Documents 10 February 17th 06 02:03 AM
Wandering text box Jim K Microsoft Word Help 7 December 23rd 05 11:27 PM
Outline Renee Hendershott Page Layout 2 December 25th 04 02:49 PM


All times are GMT +1. The time now is 09:45 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"