Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-10-2017, 12:27 PM
bilich bilich is offline VBA to Embed Object Windows 10 VBA to Embed Object Office 2013
Novice
VBA to Embed Object
 
Join Date: Mar 2017
Posts: 3
bilich is on a distinguished road
Default VBA to Embed Object

Hi,



I have a bit of code that works decent, but I would like to update to be cleaner. Right now, when you run the code it will open the dialog box for you to select a file. Once the PDF is selected, it embeds the image on the next page. When this happens it also opens up the PDF. Would there be a way to have the PDF automatically closed out when doing this?

Also, I would like to be able to create a target area for image to go to that I can change the size of and the PDF will adjust to the size of the target area. Is something like that possible?

Any help you can provide is greatly appreciated!

Code:
Option Explicit
Sub AddFileIcon()
    SendKeys "%F{TAB 4} {TAB 5}"
    Dialogs(wdDialogInsertObject).Show
End Sub


Thank you,
Reply With Quote
  #2  
Old 03-11-2017, 03:17 AM
gmayor's Avatar
gmayor gmayor is offline VBA to Embed Object Windows 10 VBA to Embed Object Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Word is not a PDF editor. What exactly is it that you are trying to do?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 03-13-2017, 06:21 AM
dwirony dwirony is offline VBA to Embed Object Windows 7 64bit VBA to Embed Object Office 2003
Advanced Beginner
 
Join Date: Oct 2016
Posts: 49
dwirony will become famous soon enough
Default

Could you be a little more specific about the steps you're taking? It's tough to know what the process is that you're using now, especially when you're using send keys...

As I'm sure you might already know, most people recommend avoiding using send keys at all costs because they're so volatile. It would probably be best to completely rewrite your code from the beginning while avoiding send keys all together.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
embed pdf to doc userman Word 9 05-25-2012 08:27 AM
Problem: object library invalid or contains references to object definitions aligahk06 Office 0 08-19-2010 12:29 PM
VBA to Embed Object can i embed name in ppt shumonsaha PowerPoint 1 07-28-2010 06:54 AM
Could not load this object as this object is not present in your computer k.gaurav Office 0 08-17-2009 09:57 PM
Embed pdf in Word doc iainbunt Word 0 12-22-2008 03:05 AM

Other Forums: Access Forums

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