Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-13-2016, 09:54 AM
Matthew Pace Matthew Pace is offline Paste Special produces different result, VBA vs. Menu Item Windows 7 64bit Paste Special produces different result, VBA vs. Menu Item Office 2010 64bit
Novice
Paste Special produces different result, VBA vs. Menu Item
 
Join Date: Oct 2016
Posts: 2
Matthew Pace is on a distinguished road
Default Paste Special produces different result, VBA vs. Menu Item

Using vba automation. Copy to clip board a chart from JMP. The chart does consist of several items, combination of test and pictures.

When I paste special > bitmap from the menu, it get what I expect, a single picture.
When I APPword.Selection.PasteSpecial (ppPasteBitmap) I get all of the items separate.

Some text, some pictures, not the same as paste special from the menu.


Any help will be greatly appreciated
Reply With Quote
  #2  
Old 10-13-2016, 04:27 PM
Guessed's Avatar
Guessed Guessed is online now Paste Special produces different result, VBA vs. Menu Item Windows 10 Paste Special produces different result, VBA vs. Menu Item Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,975
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

That is odd. I've not seen this and can't begin to work out why a single paste would do that. But I wouldn't be using the selection object either, especially when you are automating Word from a different program. And getting Word to do a clipboard conversion into a bitmap is not a great practice either.

Is it possible to export the graphic from JMP (to a temporary location) in a format that can then be imported into Word? This would be the preferred method because you should be able to control the bitmap resolution/format better than Word's clipboard conversion can do.

I've recently had a client tell me that a png bitmap in their Word 2016 document contained editable text. This is 'not possible' unless Word is doing some OCR on the graphic - Is it possible that the bitmap is being surreptitiously OCR'd by Word to make it appear your graphic is being pasted in separate objects?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 10-13-2016, 04:46 PM
Matthew Pace Matthew Pace is offline Paste Special produces different result, VBA vs. Menu Item Windows 7 64bit Paste Special produces different result, VBA vs. Menu Item Office 2010 64bit
Novice
Paste Special produces different result, VBA vs. Menu Item
 
Join Date: Oct 2016
Posts: 2
Matthew Pace is on a distinguished road
Default

Thank you for your reply.

This created the problem. I did not get any errors, but it was correct either
APPword.Selection.PasteSpecial (ppPasteBitmap)

This fixed the problem
APPword.Selection.PasteSpecial DataType:=wdPasteBitmap

This did n't work either and agin no error
APPword.Selection.PasteSpecial , , , , wdPasteBitmap

I'm an engineer, not a programmer so I do stupid things. Still strange, no error
Reply With Quote
  #4  
Old 10-13-2016, 04:57 PM
Guessed's Avatar
Guessed Guessed is online now Paste Special produces different result, VBA vs. Menu Item Windows 10 Paste Special produces different result, VBA vs. Menu Item Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,975
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Ahh. Another thing to try is exchanging the constant for its integer value.
wdPasteBitmap = 4 <-- this is word constant
ppPasteBitmap = 0 <-- This is a powerpoint constant

Using these constants when the code is running in other programs is often problematic. Try
Selection.PasteSpecial DataType:=4

This page tells you the possible datatype integer values
https://msdn.microsoft.com/en-us/lib.../ff197265.aspx
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste Special produces different result, VBA vs. Menu Item Paste Special and PDF zrpearson Word 3 05-07-2014 04:17 AM
Paste Special produces different result, VBA vs. Menu Item Paste Special: Copy and Paste Formatting Only? tinfanide Word 6 03-06-2013 12:21 AM
Outlook 'actions' menu item moved to the left? galgewater Outlook 0 07-30-2012 07:05 AM
Paste Special produces different result, VBA vs. Menu Item range.insertfile produces diff result between word 2010 and 2007 rsmedley Word 1 02-15-2012 10:48 PM
How to add a file menu item and invoke an EXE? simplyarun PowerPoint 0 07-21-2011 01:59 AM

Other Forums: Access Forums

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