Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-04-2012, 12:34 PM
mata30s mata30s is offline Word GoTo From Excel Windows 7 64bit Word GoTo From Excel Office 2007
Novice
Word GoTo From Excel
 
Join Date: Nov 2012
Posts: 13
mata30s is on a distinguished road
Default Word GoTo From Excel


Hi all,

I am wondering how to go to a bookmark in Word when its macro is ran from Excel. This is what I have in Excel at the moment:

Code:
 
    Dim wrdApp As Word.Application
    Dim wrdDoc As Word.Document
    Dim i As Integer
    Set wrdApp = CreateObject("Word.Application")
    wrdApp.Visible = True
    Set wrdDoc = wrdApp.Documents.Open(directory)    
 
    With wrdDoc
        
     If .Bookmarks.Exists("g") Then
            
           MsgBox "yes"
           wrdDoc.GoTo What:=wdGoToBookmark, Name:="g"
                    
     Else
           MsgBox "Not Found"
     End If
It all works, except the Word document does not go to the bookmark. After this I am hoping to expand on the code (such as adding Word Tables from the Excel code). Input appreciated.

Thank you,

Matt
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can this be fix in excel or should I go to word lostsoul62 Excel 1 04-18-2012 01:00 AM
From Excel to Word? lostsoul62 Word 1 03-19-2012 06:20 PM
Word GoTo From Excel Open Word w Excel & fill Word textboxes w info from Excel fields runtime error 4248 Joe Patrick Word VBA 2 01-30-2012 07:23 AM
Word GoTo From Excel Word to Excel rynman Office 5 04-19-2009 06:50 AM
Word GoTo From Excel Excel to Word retrospect1984 Excel 1 02-18-2009 06:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:20 PM.


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