Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-17-2013, 06:43 AM
KSReynolds KSReynolds is offline Save Word Files as OLE Bound Objects Windows 7 32bit Save Word Files as OLE Bound Objects Office 2003
Novice
Save Word Files as OLE Bound Objects
 
Join Date: Oct 2013
Posts: 7
KSReynolds is on a distinguished road
Default Save Word Files as OLE Bound Objects

I know that this is not a preferred method, but I have inherited a database that requires this functionality for now. I need to save my Word documents in a function to Ole Bound Objects and can't find the vba code anywhere. I have a function that prints out the reports, but would like to modify to save as ole bounds. Three stars for anyone who can help, I'm googled out!

Code:
Public Function OpenWordDoc() As Boolean 
    OpenWordDoc = True 
    Dim objApp As Object 
    Dim objWord As Object 
    Dim strSQL As String 
    Dim NewCLS_Batch As DAO.Database 
    Dim rstLatentReports As DAO.Recordset 
    Dim IntI As Integer 
    Set NewCLS_Batch = CurrentDb 
    Set rstLatentReports = NewCLS_Batch.OpenRecordset("qryselectlatentreports") 
    rstLatentReports.MoveFirst 
    Set objWord = CreateObject("Word.Application") 
    objWord.Visible = False 
    If rstLatentReports.EOF Then Exit Function 
    IntI = 1 
    With rstLatentReports 
        Do Until .EOF 
            Set objDoc = objWord.Documents.Add() 
            Dim MyNewPathName As String 
            MyNewPathName = rstLatentReports.Fields("mypathname") 
            objWord.PrintOut , , , , , , , , , , , , MyNewPathName 
            On Error Resume Next 
            .MoveNext 
            IntI = IntI + 1 
        Loop 
    End With 
    rstLatentReports.Close 
    NewCLS_Batch.Close 
End Function


Last edited by macropod; 12-17-2013 at 03:46 PM. Reason: Added code tags & formatting
Reply With Quote
  #2  
Old 12-18-2013, 05:51 PM
macropod's Avatar
macropod macropod is offline Save Word Files as OLE Bound Objects Windows 7 32bit Save Word Files as OLE Bound Objects Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi KSReynolds,

Since this appears to be Access-related, you might get better results by posting your query in the Access forum - http://www.accessforums.net/
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save Word Files as OLE Bound Objects Can no longer read and save WORD documents as TXT files bobk544 Word 2 11-24-2013 07:22 AM
Save Word Files as OLE Bound Objects Convert equation objects to inline objects sumjoh Word VBA 1 01-29-2013 08:38 PM
Save group of objects as picture - crops off image Laiza_83 PowerPoint 3 01-19-2013 06:05 PM
Casnnot save files to .pdf (word excel) JacquesW Office 10 01-19-2012 11:45 AM
Can't save Large Word files to html Gardener Word 0 12-25-2011 09:37 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:09 AM.


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