Hi ,
Well i am pretty new here and i am a beginer ,so i am asking if there is way to identify a visio page by it's unique ID or any other ways , like tha case of Shapes which are identified by : Shape.UniqueID and Masters : master.uniqueID ...
Thank you
The Page.ID is constant, it doesn't change when the page gets renamed or the page order changes. The number may be reassigned though if the page is deleted and then a new page created.
http://msdn.microsoft.com/en-us/library/ff766565.aspx (http://msdn.microsoft.com/en-us/library/ff766565.aspx)
How about when the page is created add a User defined cell and add your own unique ID to that cell.
Thank you for aswering :) , no i am facing another problem :-[ , i have some macros that are fully functional in vsd document (Dessin.vsd) and for now i am trying to get them functional for every document i create , but the problem is when i embed them into a Stencil some errors come out and i do not actualy know the reason , could you have an explanation for that ?
Could you say more about the errors? It could matter, how the macros are called. Or the code project of the stencil has to be known to the drawing or vice versa.
Somewhere in this forum is a near tutorial like thread about placing code in stencils.
i have to Marcos , Macro1 which is processing on an IE instance , and Macro2 wich deals with MSSQL , i've created to buttons for these macros to execute them , and here is the souce code to do that : Sub CreateMyButtonBar()
Dim CB As CommandBar
Dim CBS As CommandBars
Set CBS = Application.CommandBars
Set CB = CBS.Add(CommandBarName, msoBarFloating)
AddButtonToBar CB, "Macro1", "Run security application", 186
AddButtonToBar CB, "Persist", "Persist Data", 180
CB.Visible = True
End Sub
Private Sub AddButtonToBar(Bar As CommandBar, _
MacroName As String, _
Caption As String, _
Button As Integer)
Dim CBC As CommandBarControl
Set CBC = Bar.Controls.Add(msoControlButton, 1, , , True)
CBC.Style = msoButtonAutomatic
CBC.FaceID = Button
CBC.Caption = Caption
CBC.OnAction = MacroName
End Sub
the problem still now where should i put the call of the function CreateMuButtonBar inside the page "ThisDocument" of the Stencil in order to create these two buttons that appear each time i tried to open visio or when i create a new docuement or when i am working on an existing docuement !!?
Visio pages also have a "page sheet", a ShapeSheet for the page. In this respect, they exhibit some shape-like behavior, from an automation standpoint.
You get at the shape-ish part of a page using visPg.PageSheet. Here we get a GUID from a page, just like we do for a shape:
'...
Debug.Print Visio.ActivePage.PageSheet.UniqueID(Visio.VisUniqueIDArgs.visGetOrMakeGUID)
'
'Result: {A8A24720-0C84-4FDC-8551-4265247DF2F6}
You would still need to loop through all the pages in a document find the right page with the right GUID, something like:
Function GetPageByID(ByRef visDoc as Visio.Document, ByVal guid as String) as Visio.Page
Set GetPageByID = Nothing '...the default result.
Dim pg as Visio.Page
Dim guidPage as String
For Each pg in visDoc.Pages
guidPage = pg.PageSheet.UniqueID(visio.VisUniqueIDArgs.visGetGUID) '...get-only, not get or make!
If (guidPage = guid) Then
Set GetPageByID = pg
Exit Function
End If
Next
End Sub
Hi,
Thank you so much it solve a big problem. Now I can update an existing Diagram :D
Browser ID: smf
(is_webkit)
Templates: 1:
Printpage (default).
Sub templates: 4:
init,
print_above,
main,
print_below.
Language files: 1:
index+Modifications.english (default).
Style sheets: 0:
.
Hooks called: 59 (
showintegrate_autoload, cache_get_data, integrate_pre_load, integrate_load_session, integrate_verify_user, cache_get_data, integrate_user_info, integrate_load_board, cache_get_data, integrate_board_info, cache_get_data, integrate_allowed_to_general, integrate_pre_load_theme, cache_get_data, integrate_allowed_to_general, integrate_simple_actions, integrate_allowed_to_general, integrate_load_theme, integrate_pre_log_stats, cache_get_data, integrate_actions, integrate_pre_parsebbc, integrate_bbc_codes, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_menu_buttons, integrate_current_action, integrate_theme_context, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general)
Files included: 25 - 925KB. (
show/home/iw0lkfe3x6cq/public_html/vgforum/index.php, /home/iw0lkfe3x6cq/public_html/vgforum/Settings.php, /home/iw0lkfe3x6cq/public_html/vgforum/cache/db_last_error.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/QueryString.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Auth.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Errors.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Load.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Security.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Compat.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Db-mysql.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Cache/CacheApi.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Cache/CacheApiInterface.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Cache/APIs/FileBased.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Charset.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Unicode/Metadata.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Unicode/QuickCheck.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Session.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Logging.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Class-BrowserDetect.php, (Current Theme)/languages/index.english.php, (Current Theme)/languages/Modifications.english.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Printpage.php, (Current Theme)/Printpage.template.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Unicode/CaseUpper.php)
Memory used: 766KB.
Tokens:
post-login.
Cache hits: 7: 0.04829s for 22,302 bytes (
showget modSettings: 0.00074s - 19983 bytes, get known_languages: 0.04646s - 1277 bytes, get board_parents-0: 0.00026s - 2 bytes, get permissions:-1: 0.00015s - 50 bytes, get theme_settings-1: 0.00042s - 980 bytes, get log_online-update: 0.00019s - 10 bytes, get menu_buttons--1-english: 0.00007s - 0 bytes)
Cache misses: 1: (
showget menu_buttons--1-english)
Queries used: 9.
[Show Queries]