replace method of MS-Word 2000 automation object introduces a new line 
Author Message
 replace method of MS-Word 2000 automation object introduces a new line

Hi Ranjan,

First, have a look at the MS Word MVP site
( http://www.*-*-*.com/ ) for ettiquette using the
newsgroups, especially number 6.
<quote>
Don't include attachments. They very rarely add anything to the description
of the problem. Many people who regularly answer questions have their
systems set to automatically reject all messages containing attachments, so
they will never even see your question. Word documents and templates are
usually unwelcome, because of the risk that they carry macro viruses.
Screenshots are unwelcome because they are so big, compared to the amount of
information they hold. If you have an error message, *don't* post a
screenshot, just note down the text, and type it into your message. Some
error dialogs allow you to copy and paste the error message text. If they
have spent some time dealing with your problem, somebody may suggest that
you email a file to them. Alternatively, you could make the file available
on the web somewhere and include a link to it in your message, so that
anybody who is interested can take a look.
<unquote>

About your question, no, I don't suspect that it's a big problem. You might
try
Application.ScreenRefresh
to see if you can force Word to update the display so that it doesn't show
the table being pushed to the second page.

HTH

Quote:
> hi ,
> We are facing problems in using the find and replace
> automation object in MS-Word 2000.The problem is as
> follows.

> In our application find and replace method is used to
> replace a string  in the header and footer . The sample
> document does not contain a header. But it contains a
> table in the first page. After executing the find and
> replace method the bottom of the table is broken and
> pushed to the second page. Thereby a single page document
> is now made as two-page document. But when u visit the
> header and return to body the document changes to single
> page. Please confirm whether this is a issue.
> The following is the code

> With Application.ActiveDocument.Sections.Item
> (1).Headers.Item(1).Range.Find
>     .ClearFormatting
>     .Text = "What"
>     .Replacement.ClearFormatting
>     .Replacement.Text = "hello"
>     .Execute Replace:=wdReplaceAll, Forward:=True, _
>         Wrap:=wdFindContinue

> End With

> Please refer the attachment for the sample document.



Sat, 25 Dec 2004 20:46:18 GMT  
 replace method of MS-Word 2000 automation object introduces a new line
thanks for the reply.However the Application..ScreenRefresh
is not working.Can u suggest some other work around

regards
R.Ranjan

Quote:
>-----Original Message-----
>Hi Ranjan,

>First, have a look at the MS Word MVP site
>(http://www.mvps.org/word/FindHelp/Posting.htm) for

ettiquette using the
Quote:
>newsgroups, especially number 6.
><quote>
>Don't include attachments. They very rarely add anything
to the description
>of the problem. Many people who regularly answer

questions have their
Quote:
>systems set to automatically reject all messages

containing attachments, so
Quote:
>they will never even see your question. Word documents
and templates are
>usually unwelcome, because of the risk that they carry
macro viruses.
>Screenshots are unwelcome because they are so big,

compared to the amount of
Quote:
>information they hold. If you have an error message,
*don't* post a
>screenshot, just note down the text, and type it into
your message. Some
>error dialogs allow you to copy and paste the error

message text. If they
Quote:
>have spent some time dealing with your problem, somebody
may suggest that
>you email a file to them. Alternatively, you could make
the file available
>on the web somewhere and include a link to it in your
message, so that
>anybody who is interested can take a look.
><unquote>

>About your question, no, I don't suspect that it's a big
problem. You might
>try
>Application.ScreenRefresh
>to see if you can force Word to update the display so

that it doesn't show
Quote:
>the table being pushed to the second page.

>HTH


>> hi ,
>> We are facing problems in using the find and replace
>> automation object in MS-Word 2000.The problem is as
>> follows.

>> In our application find and replace method is used to
>> replace a string  in the header and footer . The sample
>> document does not contain a header. But it contains a
>> table in the first page. After executing the find and
>> replace method the bottom of the table is broken and
>> pushed to the second page. Thereby a single page
document
>> is now made as two-page document. But when u visit the
>> header and return to body the document changes to single
>> page. Please confirm whether this is a issue.
>> The following is the code

>> With Application.ActiveDocument.Sections.Item
>> (1).Headers.Item(1).Range.Find
>>     .ClearFormatting
>>     .Text = "What"
>>     .Replacement.ClearFormatting
>>     .Replacement.Text = "hello"
>>     .Execute Replace:=wdReplaceAll, Forward:=True, _
>>         Wrap:=wdFindContinue

>> End With

>> Please refer the attachment for the sample document.

>.



Sun, 26 Dec 2004 17:48:47 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. sams teachyourself ms word 2000 automation in 24 hours

2. Word 2000, SendFax method (Document object)

3. MS WORD 97 and 2000 object modules --- copyrighted?

4. Finding Word 6.0/95 files and replacing them in Word 2000 format

5. MS WORD 97 and 2000 object modules --- copyrighted?

6. New to automation - a couple questions - MS Word 97

7. -2147023170 Automation error on quit method of Word object

8. replace line with new line in ini file

9. MS PJ 2000 and MS Word via VBA

10. MS Access & MS Word Automation/Security Issue

11. Word 2000 Search and Replace Code

12. Replacing the Ctrl+N shortcut in Word 2000

 

 
Powered by phpBB® Forum Software