Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 12-12-2011, 03:46 AM
tinfanide tinfanide is offline Excel VBA: How to add a reference to Microsoft Word Object Library? Windows 7 64bit Excel VBA: How to add a reference to Microsoft Word Object Library? Office 2010 32bit
Expert
Excel VBA: How to add a reference to Microsoft Word Object Library?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Thanks for the binding reminder.
It seems to work without the reference.
In Excel VBA:
Code:
Sub lateBinding()

' no need to set reference to MS Word Object Library
Dim wrdApp As Object
Set wrdApp = CreateObject("Word.Application")
Dim wrdDoc As Object
Set wrdDoc = wrdApp.Documents.Add

wrdApp.Visible = True
wrdDoc.Sections(1).Range.Delete

With wrdDoc
    .Paragraphs.Add
    .Paragraphs(1).Range.Text = "Late Binding: no need to set reference to MS Word Object Library"
End With

Set wrdDoc = Nothing
Set wrdApp = Nothing

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
option Paste special...as 'Microsoft Excel Chart Object' NOT available Intruder PowerPoint 0 12-24-2010 06:28 AM
Problem: object library invalid or contains references to object definitions aligahk06 Office 0 08-19-2010 12:29 PM
Problem with my microsoft word com object in c# web application Naresh_1210 Word VBA 0 03-11-2010 12:26 AM
Inserting citations using the reference function in Microsoft Word 2007? aeyara Word 0 09-28-2009 05:33 PM
Access Object library 10 Gyto Office 0 10-09-2008 09:04 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft