Paper Height

Z

ZyRaIN

Hi guys,

Need some help reguarding Paper Height, when I use the:

Dim height As Double
height = page.Application.ActiveDocument.PaperHeight("mm")

I don't get the right size out, later on in my code I use
page.export(filename.gif) and when I look at these *.gif files I can
see that they have a different height and width than the value I get
when I use the form.

Hope to hear from you.

/ZyRaIN
 
J

John

Try this:

height = Application.ActivePage.PageSheet.Cells("PageHeight").Result(70)

Hope that helps

Best regards

John
 
Z

ZyRaIN

Hi John,

Thanks for your quick response but it didnt help, Not matter which
formula I use I get the same result, is there anyway that I can get the
program to measure on the *.gif images and not directly on the visio
document.

Sencierely

ZyRaIN
 
J

John

Hi there,

Sorry it didn't help. I'm afraid I'm not completely clear on what you're
trying to achieve. Can you post the code so we can give more advice?

Best regards

John
 
Z

ZyRaIN

Below you can see my code, want I want todo is very simple I just want
the get the right pixelsize of the images which I export, most of my
visio pages are 744x1049 pixel,
and when I use the formulas written below I get 5xx pixels.

I need the correct information about my images, because later on I want
to draw clickable links on the images, where the shapes are located.

Hope you understand what Im trying to say.


------------------------------------------------------------------------------------------------------------------------------------------------------

Public Sub mySaveAsWeb(ByVal list As ArrayList)

Dim page As Visio.Page
Dim shape As Visio.Shape

For Each page In myVisio.ActiveDocument.Pages

Dim height As Double
Dim width As Double

height =
page.Application.ActivePage.PageSheet.Cells("PageHeight").Result("pt")
width =
page.Application.ActivePage.PageSheet.Cells("PageWidth").Result("pt")

If page.Type = Visio.VisPageTypes.visTypeBackground Then
For Each shape In page.Shapes

Dim xValueInMM As String
Dim yValueInMM As String
Dim xValueInPt As Double
Dim yValueInPt As Double
Dim newXValueInMM As Double
Dim newYValueInMM As Double
Const CONVERTTOPT As Double = 2.83464

xValueInMM = shape.Cells("pinx").Formula
yValueInMM = shape.Cells("piny").Formula
xValueInMM = xValueInMM.Replace("mm", "")
yValueInMM = yValueInMM.Replace("mm", "")

newXValueInMM = CType(xValueInMM, Double)
newYValueInMM = CType(yValueInMM, Double)

xValueInPt = (newXValueInMM * CONVERTTOPT)
yValueInPt = (newYValueInMM * CONVERTTOPT)
'yValueInPt = height - yValueInPt

Dim filename As String = ("C:\Documents and
Settings\mje\My Documents\test\Gif - files\Pages\" & page.Name &
".gif")
page.Export(filename)
page.Import(filename)

Debug.Print("X Value in PT", xValueInPt)

Next
End If
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top