News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

PageHeight returning inches for some reason

Started by morelup, January 16, 2020, 01:26:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

morelup

So I have an addin that is doing some logic based off of PageHeight.  This works fine on my laptop that i've developed on, and everyone i've deployed this addin to has not had this issue.  On my newly built PC though when I do the below logic:

_pageHeight = Convert.ToDouble(_page.PageSheet.Cells["PageHeight"].Formula.Replace(" mm.", ""));

I'm getting an error because .Formula is returning the value in inches.  The strange thing is, i'm opening up identical files on both my working laptop and non-working desktop, and when inspecting the page on the desktop it shows as "PageHeight = 210 mm"

Any ideas what I am doing wrong?

morelup

Ok, strangest thing, now this desktop works fine, but I have to change the tab I'm looking at when the file opens up (note i can go back to that tab after changing) and it works fine.

ImAPictureFormat

Most of my experience is with VBA, but I believe you could do something like this to always get the result in millimeters across your devices:


_pageHeight = Convert.ToDouble(_page.PageSheet.Cells["PageHeight"].Result(visMillimeters).Replace(" mm.", ""));


The constant visMillimeters I'm getting from the documentation here: https://docs.microsoft.com/en-us/office/vba/api/visio.visunitcodes

Hope this helps.

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 174 (show)
Files included: 35 - 1407KB. (show)
Memory used: 1069KB.
Tokens: post-login.
Cache hits: 14: 0.00280s for 26,723 bytes (show)
Cache misses: 4: (show)
Queries used: 18.

[Show Queries]