index > Visual Studio Tools for Office > Help embedding Excel documents into a Word Document

Help embedding Excel documents into a Word Document


Hi there

Can someone tell me how to or direct me to an appropriate tutorial that can show me how I can, programmatically, insert an excel 2003 sheet into a word 2003 document by using the VSTO

EG:

Document a = WordDocument

Document b = ExcelSheet

a.Section(n).Insert(b, DisplayAsIcon)

I have hunted for advice on this but cannot find it anywhere. I am using VS.NET 2005 and am not fussed on a C# or VB.NET solution I just need to be able to insert the document.

Thanks!

Hatchman
I saw a question like this in the word.vba.general newsgroup last week. Was that your's? Are you all set, now?


-- Cindy Meister (Word MVP)
Cindy Meister

Hi Cindy

I'm afraid I haven't heard anything back at all

Do you know of a way that in which this can be done?

Regards

Andrew

Hatchman

Hi Andrew

Since you want to display as an icon, are you wanting to bring in (and link?) an existing sheet, then?

The best way to get started on something like this is to record your actions in a macro. That will give you the basic syntax. An embedded Excel sheet is an OLE object, BTW; Word treats these like graphical objects.

If you need more help beyond the actual insertion the macro recorder gives you, please post in the office.developer.automation newsgroup. Copy the code the macro recorder gave you (or the code you've adapted from the recorder) and describe exactly where you're having problems.




-- Cindy Meister (Word MVP)
Cindy Meister

Thanks again Cindy.

Unfortunately I didn't want to go down the VBA Macro route, I was hoping something in VSTO would allow me to do it instead.

Hatchman
There's nothing special built into VSTO for inserting or working with embedded OLE objects; automation of the COM object model is the only possibility. You use the VBA route to get the basic object model SYNTAX. Our goal in this forum is to show you how to work with the tools, and one of the tools at your disposal is the macro recorder.


-- Cindy Meister (Word MVP)
Cindy Meister
reply 6

You can use google to search for other answers

 

More Articles

If an Add-In won't load, then what?
VBA-Drag and Drop Outlook Object(IE Address) into Word
Visual Studio 2005 Word and Outlook 2003
Displaying an icon on a commandbarbutton object
Help deployment Microsoft.VisualStudio.Tools.Applications.Runtime...
Serious: Update multiples tables of Database through excel withou...
How to add Excell VSTO app into word
Can open Word file in J#, but not in C#
SELECT Statement against Excel file?
Merging documents in Word
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

XML View and how to change reading pane …
Access Web browser from MS Word 2003
Outlook addin AutoUpdate
starting word
what is VB_ProcData.VB_Invoke_Func = &qu…
After installing VSTO2005 no Office Temp…
Dermining if "Out Of Office" i…
Remove link in sharepoint
help me! how to response the drag & …
Xml Toolbox issue
Problem with Refactor - Rename feature.
How to create an extended worksheet from…
Apply VSTO to all Word and Excel documents
Chart Component
the differents between Interop and Tools?

Hot Articles

Release object
Problems with office sp1 installation
Generating an MS Word doc on the fly
Problem using ServerDocument.AddCustomiz…
VSTO 2005 questions...
VSTO2005 vs. VS2005Prof
storing a variable
VSTO and OLE Automation
seprating location of vsto excel sheet a…
Deployment a Word Solution with actions …
Delete Excel Worksheet event
Excel - Clear contents for a sheet
KB908002 - The 2003 exe redist
auto_close addin unload
Web Publish Word Solution

Recommend Articles

Export / Save Workbook without Customiza…
VSTO install balks at VS 2005 beta
VSTO and Office 2003
Rules
Addin for Outlook2000
Highlighting code in an email
Can't Create VSTO project
Modifying the Office 2007 Ribbon
ContactItem Copy permissions error in Ou…
Error 0x80040F04 while Accessing Outlook…
VSTO 2005 Word Bookmarks
Is VSTO 2005 Required to build a Windows…
How to pass parameters to a Word VSTO so…
VSTO property for hidden Excel sheets
Create a "Bare" Workbook From …