Read and Write Word file

R

Raj

Hi ,

I am working on vb.net and word application automation application.

my question is :.

1. I want to save one file into another file ,
example.

a) my existing file name is "Raj.DOc" and containing some page.

b) and second file is "Raj2.DOc" it also containing some page.

c) So I want to Save "Raj2.Doc" file into "Raj.doc" file. with all the
page

Please help me out with code.

i will be very grateful to you.


Thanks and Regards

Raj Kumar Mishra
jcast Networks Ltd.
New Delhi.
India.
91-51678212,13,14



--
Raj Kumar Mishra
jcast Networks Ltd.
New Delhi.
India.
91-51678212,13,14
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Raj,

With VBA, use

Dim Source as Document, Target as Document
Set Source=Documents.Open("Raj2.Doc)
Set Target=Documents.Open("Raj.DOc"_
Target.Range.InsertAfter Source.Range
Target Save
Source.Close

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
R

Raj

hi,
Thanks for your instent Reply,

but extermanly i am Sorry again,

this code not working properly.

"Target.Range.InsertAfter Source.Range" This line of code is giving Erorr,
Please give me complete Code Example so that i can make finish my project.

Thanks again
Raj

"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS"
 
J

Jean-Guy Marcil

Hi Raj,

I believe there were small typos in Doug's code:
Try:

Dim Source as Document, Target as Document
Set Source=Documents.Open("Raj2.doc") 'Quote missing
Set Target=Documents.Open("Raj.doc") ' "_" to be replaced by ")"
Target.Range.InsertAfter Source.Range
Target.Save ' "." missing
Source.Close


--
Cheers!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Thanks Jean-Guy

I should compose code in the VBE, not OE.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top