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, if 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 1 3783
You need to use a string builder object instead of the string object.
Imports System.Text
dim str as new StringBuilder
i = 0
Do While i < 999
str.append("1")
i = i + 1
Loop
msgbox(str.toString)
"a" <a@abc.com> wrote in message
news:O7**************@TK2MSFTNGP10.phx.gbl... 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, if 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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: alexmaster_2004 |
last post by:
hi
i have made an application using C# that access sql2000.
this application is just used to insert data to the database.
i use something like this in my code:
//
string colmnA = TextBox1.Text;...
|
by: Lelle |
last post by:
Hello !
how can i insert text containg code examples from a textbox into a database
using SQL insert statment.
i have no problem to just add text that dont contains code and script
examples...
|
by: Shapper |
last post by:
Hello,
I have created 3 functions to insert, update and delete an Access
database record. The Insert and the Delete code are working fine.
The update is not. I checked and my database has all...
|
by: Milos Prudek |
last post by:
I need to insert a value = max(value)+1, where max is a select limited
by a 'where' clause. Like this:
INSERT INTO table (idthread, idsection,txt)
VALUES (
(SELECT max(idthread)+1 FROM table...
|
by: Ed Dror |
last post by:
Hi there,
I have ASP
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Guestbook.aspx.vb"
Inherits="Guestbook" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
|
by: Martin Z |
last post by:
INSERT INTO dbo.Transmission
(TransmissionDate, TransmissionDirection,
Filename, TransmittedData)
VALUES
(@TransmissionDate,@TransmissionDirection,@Filename,@TransmittedData);
SELECT @retVal =...
|
by: skanemupp |
last post by:
in this program when using the "c"-button it deletes the last token
entered. i want to delete the token after the mousecursor.
lets say the string is: 12*(81**.5+12) and i put the cursor between...
|
by: =?Utf-8?B?bXBhaW5l?= |
last post by:
Hello,
I am completely lost as to why I can't update a DropDownList inside a
DetailsView after I perform an insert into an object datasource. I tried to
simply it down to the core demostration:...
|
by: pavanponnapalli |
last post by:
hi,
I have designed a module, which contains a template for insert command.
The code is as under:
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |