473,586 Members | 2,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VBA, .NET and embedding OLE objects in a Word document.

At the moment I have place-holders in my Word document (before you say it,
yes I've posted this query in the VBA newsgroups but they are a little
slow - in fact reply was non-existent!). I'm running through the document,
finding the placeholders (which are jpeg images) and replacing them with OLE
objects, the location of which is stored in a hyperlink on the image. The
reason I'm doing this is because my reporting package flattens OLE objects
down to images, rather than embedding them directly and my users need to be
able to manipulate OLE objects in-place in Microsoft Word when the report is
done.

My question is how do you "replace" an image with an OLE object with word
VBA? I'm able to add an OLE object using the following, but once I've found
an image i want to replace, how do i insert the new object in the exact same
place on the page as the image? (after deleting the image of course).

' Create the Word object

theApplication = CType(CreateObj ect("Word.Appli cation"),
Word.Applicatio nClass)

' Open the report file

theApplication. Documents.Open( "C:\Documen ts and
Settings\R.Tuck er\Desktop\test ing.doc")

' Add an OLE object

theApplication. ActiveDocument. InlineShapes.Ad dOLEObject(Clas sType:="xxxx.yy y
y", FileName:="C:\D ocuments and Settings\R.Tuck er\Desktop\Gran d Power
3.tgw", LinkToFile:=Fal se,
DisplayAsIcon:= False)


Nov 20 '05 #1
0 1904

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
4479
by: Anna | last post by:
Hi all. I want to embed the EMBED tag in the object tag. I understood that I need to provide a PARAM tag inside the OBJECT whose value will hold the content of EMBED src attribute, but after that I've got confused. For example, what should be put into classid and codebase attributes of the OBJECT now embedding the EMBED tag?
4
3243
by: Lisa | last post by:
Hi - I'm able to open excel workbooks and word documents, but I can't seem to copy excel charts, named ranges, etc. to a word document. Anyone know of good reference material in this area? What little documentation I've been able to find focuses on using only one office app at a time. Thanks for your help
0
1420
by: hq4000 | last post by:
Given AStyleSheet.xsl : <AStyleSheet> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.mytest.mytest2.mytest3.com" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <xsl:element name="Test">it works</xsl:element> </xsl:template>
4
1489
by: N. Graves | last post by:
Thanks for reading my request for help! I have a Bound Object Frame that I have stored a Word Document. When I double click to view the document it is very small and unreadable. If I try to zoom it to 100% it reverts right back to a small image. Tried to click and drag the edge to resize it that didn't work either. When I open this form...
0
925
by: Dean Richardson | last post by:
Hello, I have a word document embedded into a WebBrowser control on a Windows form. I currently hide and show the commandbars needed, but I do not know how to hide the ruler on the word doc. Below is a code I use for the command bars - is there anything similar for the ruler? oDocument.CommandBars("Formatting").Visible = True
1
1958
by: mplsken | last post by:
I looked around for the right discussion thread to post this to, and apologize if this is the wrong one ... feel free to redirect me - I'm new to this board! I've seen several references in other postings talking about embedding Excel in Word documents, but I am trying to create a Requirements template where the first tab represents the...
1
2736
by: jsweeney | last post by:
Beth Massi has an excellent article on merging data with docx using Visual Basic - click here for the article In the article, she cuts and pastes the document.xml file to create an XDocument, then manually replaces the Word field delimiters (« ») with ASP field delimiters (<%= %>). I have developed a method that takes the path/file name...
0
1381
Pittaman
by: Pittaman | last post by:
Hello, We're developing an application (.NET 2.0) that let's users drop documents in the application and allows users to show some document types "embedded". For example, a textfile would appear as a text box. We also want this for office documents, and want to give the user the possibility to edit these documents inline, so they will not...
6
4441
by: Sajeena | last post by:
<?php // starting word $text = "My Text"; //Start MS Word $Word = new COM("word.application") or die("Failure: Word did not start"); echo("WORD has started."); //Formating the Font $Word->Visible=0;
0
7911
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8200
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7954
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.