Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
a a is offline
external usenet poster
 
Posts: 1
Default WordBasis insert command -- text length limit

I am using following code to insert text into the word document, using VB
from excel.

Any text which has length more than 240 characters is not getting inserted
into the document.

Any suggestions are highly appreciated.

Thanks,
----------------------------------------------------------------------------
------------------------------------

Sub GenerateADRFinding()

' Dimension the variables.
Dim PokeRange As Object
Dim Chan As Integer
Dim i As Long
Dim temps As String
Dim insertS As String

' Create an range object to poke.
Set PokeRange = Range("CheckList!a1")

' Initiate a channel to Word using a file as the topic.
Chan = DDEInitiate("WinWord", templateFile)

' Execute a few WordBasic commands.
DDEPoke Chan, "\StartOfDoc", PokeRange

i = 0
Do While i < 240 9 '( 240 does not work)

temps = temps & "1"
i = i + 1
Loop

insertS = "[Insert "" " & temps & " "" ]"""

DDEExecute Chan, insertS
'DDEExecute Chan, "[FileSaveAll]"
DDEExecute Chan, "[FileExit]"

' Terminate the DDE channel.
DDETerminate Chan




  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default WordBasis insert command -- text length limit

this is an excel newsgroup. you may have better luck
posting in the word newsgroup.

-----Original Message-----
I am using following code to insert text into the word

document, using VB
from excel.

Any text which has length more than 240 characters is not

getting inserted
into the document.

Any suggestions are highly appreciated.

Thanks,
----------------------------------------------------------

------------------
------------------------------------

Sub GenerateADRFinding()

' Dimension the variables.
Dim PokeRange As Object
Dim Chan As Integer
Dim i As Long
Dim temps As String
Dim insertS As String

' Create an range object to poke.
Set PokeRange = Range("CheckList!a1")

' Initiate a channel to Word using a file as the

topic.
Chan = DDEInitiate("WinWord", templateFile)

' Execute a few WordBasic commands.
DDEPoke Chan, "\StartOfDoc", PokeRange

i = 0
Do While i < 240 9 '( 240 does not work)

temps = temps & "1"
i = i + 1
Loop

insertS = "[Insert "" " & temps & " "" ]"""

DDEExecute Chan, insertS
'DDEExecute Chan, "[FileSaveAll]"
DDEExecute Chan, "[FileExit]"

' Terminate the DDE channel.
DDETerminate Chan




.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Criteria length limit in SUMIF() BAC Excel Worksheet Functions 16 April 29th 23 03:41 AM
Limit to the length of a list in a combo box Fraser B Excel Discussion (Misc queries) 3 February 9th 09 02:44 PM
limit text length in a text box in excel 2003 Darren New Users to Excel 1 May 14th 08 02:14 PM
Text length limit ConfusedAsEver945 Charts and Charting in Excel 1 February 12th 08 09:31 AM
limit text length after importing data Jean N. Excel Worksheet Functions 2 June 7th 06 09:31 PM


All times are GMT +1. The time now is 02:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"