Group:  Microsoft Word ยป microsoft.public.word.vba.addins
Thread: Copy the content of external documet in the active document

Geek News

Copy the content of external documet in the active document
dev 4/18/2007 3:12:50 PM
Hi to all!

I need to do a simple add-in.

I want an add-in that takes the content of external document (.doc
extension) and put all that content in the document I using now.

For examples:
I have two files "Test1.doc" and "Test2.doc"; the "Test2.doc" contain the
string "blah blah" and "Test1.doc" contain "this is my doc".

I open the file named "Test1.doc" and I see only "this is my doc"; now I
want to put the content of "Test2.doc" in this document so I can see "this is
my docblahblah".

How can I do this?

thank you all!
Re: Copy the content of external documet in the active document
"Perry" <drumper[ at ]gmail.com> 4/18/2007 6:15:47 PM
doc1.Content.FormattedText = doc2.Content

whereby, doc1 is an object variable pointing to Test1.doc and
doc2 pointing to Test2.doc

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE



"dev" <dev[ at ]discussions.microsoft.com> schreef in bericht
news:49C84416-9871-433C-B068-F9E625CF384E[ at ]microsoft.com...
[Quoted Text]
> Hi to all!
>
> I need to do a simple add-in.
>
> I want an add-in that takes the content of external document (.doc
> extension) and put all that content in the document I using now.
>
> For examples:
> I have two files "Test1.doc" and "Test2.doc"; the "Test2.doc" contain the
> string "blah blah" and "Test1.doc" contain "this is my doc".
>
> I open the file named "Test1.doc" and I see only "this is my doc"; now I
> want to put the content of "Test2.doc" in this document so I can see "this
> is
> my docblahblah".
>
> How can I do this?
>
> thank you all!

Re: Copy the content of external documet in the active document
dev 4/18/2007 10:28:01 PM
ok, I found a way for select the opened document using OpenDocument, so I can
get the doc1 object, how can I take the object of doc2 if I know just the
name?

thank u



"Perry" wrote:

[Quoted Text]
> doc1.Content.FormattedText = doc2.Content
>
> whereby, doc1 is an object variable pointing to Test1.doc and
> doc2 pointing to Test2.doc
>
Re: Copy the content of external documet in the active document
dev 4/19/2007 4:00:03 PM
I used doc.content.insertfile("test2.doc")

thank you ! :-)


"dev" wrote:

[Quoted Text]
> ok, I found a way for select the opened document using OpenDocument, so I can
> get the doc1 object, how can I take the object of doc2 if I know just the
> name?
>
> thank u
>
>
>
> "Perry" wrote:
>
> > doc1.Content.FormattedText = doc2.Content
> >
> > whereby, doc1 is an object variable pointing to Test1.doc and
> > doc2 pointing to Test2.doc
> >
Re: Copy the content of external documet in the active document
dev 6/6/2007 9:01:00 PM
Hi Perry,

I need to make an addin... this addin have to get all the data insert in the
document the user using, and in real time, the addin have to get the byte
array of the data.

How can I do this?
I used FormattedText but I can't do the Cast from formattedText to Byte array

thank u




"Perry" wrote:

[Quoted Text]
> doc1.Content.FormattedText = doc2.Content
>
> whereby, doc1 is an object variable pointing to Test1.doc and
> doc2 pointing to Test2.doc
>
> --
> Krgrds,
> Perry
>
> System:
> Vista/Office Ultimate
> VS2005/VSTO2005 SE
>
>
>
> "dev" <dev[ at ]discussions.microsoft.com> schreef in bericht
> news:49C84416-9871-433C-B068-F9E625CF384E[ at ]microsoft.com...
> > Hi to all!
> >
> > I need to do a simple add-in.
> >
> > I want an add-in that takes the content of external document (.doc
> > extension) and put all that content in the document I using now.
> >
> > For examples:
> > I have two files "Test1.doc" and "Test2.doc"; the "Test2.doc" contain the
> > string "blah blah" and "Test1.doc" contain "this is my doc".
> >
> > I open the file named "Test1.doc" and I see only "this is my doc"; now I
> > want to put the content of "Test2.doc" in this document so I can see "this
> > is
> > my docblahblah".
> >
> > How can I do this?
> >
> > thank you all!
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net