Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2019, 07:40 AM
Emby Emby is offline How to get image from bookmark? Windows 7 32bit How to get image from bookmark? Office 2000
Novice
How to get image from bookmark?
 
Join Date: Nov 2017
Posts: 10
Emby is on a distinguished road
Default How to get image from bookmark?


Would anyone tell me how to get image from bookmark1 in document1 and paste this image to bookmark2 in Document2 ?
Reply With Quote
  #2  
Old 03-30-2019, 08:01 AM
gmaxey gmaxey is online now How to get image from bookmark? Windows 10 How to get image from bookmark? Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

You can do it using the formattedtext method:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oDoc1 As Document, oDoc2 As Document
  Set oDoc1 = Documents(1)
  Set oDoc2 = Documents(2)
  oDoc1.Bookmarks("TargetBMName").Range.FormattedText = oDoc2.Bookmarks("SouceBMName").Range.FormattedText
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 03-31-2019, 07:26 AM
Emby Emby is offline How to get image from bookmark? Windows 7 32bit How to get image from bookmark? Office 2000
Novice
How to get image from bookmark?
 
Join Date: Nov 2017
Posts: 10
Emby is on a distinguished road
Default

Dear Grey Maxey

Thanks for your kind help. But how to remain bookmark "TargetBMName" after execute your marco?
Reply With Quote
  #4  
Old 03-31-2019, 07:58 AM
gmaxey gmaxey is online now How to get image from bookmark? Windows 10 How to get image from bookmark? Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

What do you mean, "How to remain bookmark ....?


I don't what your bookmarks are actually named and the code was just an example. The idea is that you have two documents e.g., Doc A and Doc B and each has a named bookmark. The code sets the formatted text content of one as the formatted text content of the other.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #5  
Old 04-01-2019, 07:30 AM
Emby Emby is offline How to get image from bookmark? Windows 7 32bit How to get image from bookmark? Office 2000
Novice
How to get image from bookmark?
 
Join Date: Nov 2017
Posts: 10
Emby is on a distinguished road
Default

Dear Grey Maxey

I am sorry to have confused you. I make some wrong steps in my macro led to overwrite the target bookmark in Doc2.
Reply With Quote
  #6  
Old 04-02-2019, 02:03 PM
macropod's Avatar
macropod macropod is online now How to get image from bookmark? Windows 7 64bit How to get image from bookmark? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
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

In document 2, go to Insert|Object>Text from File, select the file, then insert the bookmark name in the 'Range' box. With this approach, any changes to the bookmarked image in document 1 will be reflected in document 2.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 04-03-2019, 07:32 AM
Emby Emby is offline How to get image from bookmark? Windows 7 32bit How to get image from bookmark? Office 2000
Novice
How to get image from bookmark?
 
Join Date: Nov 2017
Posts: 10
Emby is on a distinguished road
Default

Dear Paul

I really appreciate your help.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get image from bookmark? Pasting Image inside Table and Resize Image Not Working Grahamers2002 Drawing and Graphics 5 07-02-2018 04:49 PM
Find Bookmark, move to bookmark, execute code, repeat raymm3852 Word VBA 10 04-15-2016 06:21 PM
How to get image from bookmark? Bookmark not replaced when inserting but to lower right corner of image newbieX Word VBA 6 11-20-2015 02:03 PM
How to get image from bookmark? Bookmark Not Showing Bookmark RegAudit Word 6 03-16-2015 11:08 PM
How to get image from bookmark? TOC: Link to bookmark or image Mijin Word 2 09-22-2011 03:14 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:58 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