Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 11-20-2015, 02:03 PM
macropod's Avatar
macropod macropod is offline Bookmark not replaced when inserting but to lower right corner of image Windows 7 64bit Bookmark not replaced when inserting but to lower right corner of image Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,523
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 Greg,

I was assuming the bookmark was empty before inserting the InlineShape. In that case, the code I posted should work just fine. That said, the OP has a solution, so NFA required.

Generically, the code to update the pic in a bookmarked range would be:

Code:
Sub Demo()
Dim wdRng As Range, BkMkNm As String
BkMkNm = "MyBookmark"
With ActiveDocument
  'Confirm that the bookmark exists
  If .Bookmarks.Exists(BkMkNm) Then
    Set wdRng = .Bookmarks(BkMkNm).Range
    'Delete existing contents
    wdRng.Text = vbNullString
    'Insert Pic
    .Range.InlineShapes.AddPicture FileName:="PictureFullName", Range:=wdRng
    'Extend Range
    wdRng.End = wdRng.End + 1
    'Re-apply bookmark
    .Bookmarks.Add BkMkNm, wdRng
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
access 2010, bookmarks, vba code



Similar Threads
Thread Thread Starter Forum Replies Last Post
Losing image resolution when inserting image into MS word (2011: Mac) Mario.N Drawing and Graphics 0 11-23-2014 02:38 AM
Bookmark not replaced when inserting but to lower right corner of image Image blurry when inserting 72dpi JPEGS sscad27 Word 1 08-20-2014 12:46 PM
Problem Inserting Image rbonnell PowerPoint 1 07-22-2014 07:15 AM
Inserting a particular image based on a combobox selection LeonieD PowerPoint 2 06-27-2014 05:39 PM
Bookmark not replaced when inserting but to lower right corner of image 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 07:22 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