#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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 |
#3
|
|||
|
|||
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 |
#4
|
||||
|
||||
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 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Paste Special and PDF | zrpearson | Word | 3 | 05-07-2014 04:17 AM |
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 |
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 |