Trouble getting graphs copied from stability into word through VBA Design.CopyImage

Hi there,

I'm trying to automate data exchange from Maxsurf Stability to Word for reporting. Now specifically I'm running a large angle stability analysis, and trying to get a copy of the stability curve from Maxsurf Stability into my Word report. There's the handy .Design.CopyImage method which should do exactly that, however I don't get consistent results. My VBA code is as follows

hmApp.Design.CopyImage View:=6, Width:=700, Height:=450
LASgraph.Collapse Direction:=wdCollapseEnd
LASgraph.Paste

Now the CopyImage method requires a width and height to be specified. Height I found is just scaling the full image of the graph to the specified height, which is good. But width somehow crops the image, instead of scaling it. So through trial and error I found the width that corresponded with the full graph picture, which initially resolved the issue. However when I adjust the size of the graph display in stability (e.g. maximize it), this changes the size of the initial bitmap apparently so that I'm again stuck with only half the graph. It seems that this width setting is (mistakenly?) related to the window size of the graph window in stability, instead of just setting the scale factor for the entire bitmap similar to what the height setting does.

Did anyone encounter this before and found a workaround?

Many thanks on forehand!

Parents Reply Children
No Data