Highlighted
Absent Member.
Absent Member.
870 views

[archive] Using ActiveX; inserting file in Word

[Migrated content. Thread originally posted on 26 October 2005]

Hi all,

can someone please help me.
I want to insert a file in a Word document using activeX from ACU GT.
The new file to insert in the Word document is also a Word document, and has to be inserted on a specific place in the original Word document.
Can someone help me to handle this, if possible with some statements to use with the help of WORD.DEF.

Thanx
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Using ActiveX; inserting file in Word

I figure the key for you is the method InsertFile of the Range class.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Using ActiveX; inserting file in Word

Thanx, i now can insert a file within a Word document using the InsertFile command.
I only can't find how to get the correct position in my Word document to insert the other file.
Suppose i have somewhere in my Word document the word "Hello", how can i insert the other file into my Word document after the word "Hello".
Or is there another way to position the correct place to insert a file?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Using ActiveX; inserting file in Word

Originally posted by LauraP
Suppose i have somewhere in my Word document the word "Hello", how can i insert the other file into my Word document after the word "Hello".


Ok, this is a shot in the dark. But how about something along the line of:

Modify oDocument Selection::Find::Text = "Hello".
Modify oDcoument Selection::Find::Execute().

This should position you at the "Hello", how if you then do this:

Modify oDocument Selection::MoveRight(
       BY NAME @Unit wdWord BY NAME @Count 1 )

And then do the Insertfile I figure it should be.

If this doesn't entirely match up to your expectations, I suggest you turn on the macro in Word, do what you want to do manually, stop the macro and take a look at the recorded code.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.