Originally posted by joemo2003
visio textbox resize
Collapse
X
-
Originally posted by SammyBRemember, you are in a multiple application world (Excel & Visio). c should be Dim'ed as Visio.Character s. My sample was just a Visio macro. Keep :)!
I try to save the same file name with extension date and time, but all I know is use the vsDoc.save or vsApp.DoCmd(vis CmdFileSave).Comment
-
Originally posted by joemo2003great, that work. One more question, how to use the SaveAsEx function?
I try to save the same file name with extension date and time, but all I know is use the vsDoc.save or vsApp.DoCmd(vis CmdFileSave).Code:Dim sNew As String sNew = Split(ActiveDocument.Name, ".")(0) ' Strip filetype sNew = sNew & "-" & Format(Now(), "yyyy-mm-dd") & ".vsd" MsgBox "Saving chart as readonly in " & sNew ActiveDocument.SaveAsEx sNew, visSaveAsRO
Comment
-
I think the use the DoCmd to open visio is simpler than the one you help me before.
Code:Set vsApp = New Visio.Application vsApp.DoCmd (visCmdFileOpen)
How can I make the cancel work too?Comment
-
Originally posted by joemo2003I think the use the DoCmd to open visio is simpler than the one you help me before.
Code:Set vsApp = New Visio.Application vsApp.DoCmd (visCmdFileOpen)
How can I make the cancel work too?
Code:Dim vFile As Variant vFile = Application.GetOpenFilename("All Visio Files (*.vs*;*.v?x), *.vs*;*.v?x") If vFile = False Then Exit Sub MsgBox "Open Visio file, " & vFile
Code:Dim vsApp As Visio.Application Dim vsDoc As Visio.Document Set vsApp = CreateObject("Visio.Application") On Error GoTo PressedCancel vsApp.DoCmd (visCmdFileOpen) On Error GoTo 0 ' Resume normal error processing Set vsDoc = vsApp.ActiveDocument MsgBox "Continue Processing..." Exit Sub PressedCancel: vsApp.Quit
Comment
-
Originally posted by SammyBIt's not simpler if it doesn't work. Use Excel.GetOpenFi lename and make the response a Variant. If the user presses Cancel, then the Variant is False. Weird, but standard Microsoft:
Code:Dim vFile As Variant vFile = Application.GetOpenFilename("All Visio Files (*.vs*;*.v?x), *.vs*;*.v?x") If vFile = False Then Exit Sub MsgBox "Open Visio file, " & vFile
Code:Dim vsApp As Visio.Application Dim vsDoc As Visio.Document Set vsApp = CreateObject("Visio.Application") On Error GoTo PressedCancel vsApp.DoCmd (visCmdFileOpen) On Error GoTo 0 ' Resume normal error processing Set vsDoc = vsApp.ActiveDocument MsgBox "Continue Processing..." Exit Sub PressedCancel: vsApp.Quit
Comment
-
Sam, help again.
In commondbutton1, I have
Code:Dim vsDocs As Visio.Documents Dim vsDoc As Visio.Document Set vsDocs = vsApp.Documents Set vsDoc = vsDocs.Open("D:\folderxx\test.vsd") Set vsDoc = vsApp.ActiveDocument vsApp.Visible = False
Code:sNew = Split(vsDoc.Name, ".")(0) sNew = sNew & "(" & Format(Now(), "MM_dd_yyyy") & ".vsd" vsApp.ActiveDocument.SaveAsEx sNew, visSaveAsRO vsApp.quit
Comment
-
Originally posted by joemo2003I still cannot figure out how to use the path function. can you specify little bit more?
Code:Sub OpenExisting() Dim vsApp As Visio.Application Dim vsDoc As Visio.Document Set vsApp = CreateObject("Visio.Application") On Error GoTo PressedCancel vsApp.DoCmd (visCmdFileOpen) On Error GoTo 0 ' Resume normal error processing Set vsDoc = vsApp.ActiveDocument MsgBox "Continue Processing..." Dim sNew As String sNew = Split(vsDoc.Name, ".")(0) sNew = sNew & "-" & Format(Now(), "MM_dd_yyyy") & ".vsd" vsApp.ActiveDocument.SaveAsEx vsDoc.Path & sNew, visSaveAsRO vsApp.Quit PressedCancel: vsApp.Quit End Sub
Comment
-
Originally posted by SammyBPutting the Open/Close all together, I have:
Code:Sub OpenExisting() Dim vsApp As Visio.Application Dim vsDoc As Visio.Document Set vsApp = CreateObject("Visio.Application") On Error GoTo PressedCancel vsApp.DoCmd (visCmdFileOpen) On Error GoTo 0 ' Resume normal error processing Set vsDoc = vsApp.ActiveDocument MsgBox "Continue Processing..." Dim sNew As String sNew = Split(vsDoc.Name, ".")(0) sNew = sNew & "-" & Format(Now(), "MM_dd_yyyy") & ".vsd" vsApp.ActiveDocument.SaveAsEx vsDoc.Path & sNew, visSaveAsRO vsApp.Quit PressedCancel: vsApp.Quit End Sub
Comment
-
Originally posted by SammyBYou use the Characters object:
Code:Dim s As String, i As Integer s = "Not Fun" Dim c As Characters Set c = ActivePage.Shapes(1).Characters i = InStr(c.Text, s) c.Begin = i - 1 c.End = i - 1 + Len(s) c.CharProps(visCharacterSize) = 16 c.CharProps(visCharacterStyle) = visBold + visItalic c.CharProps(visCharacterColor) = visRed
Sam, do you still remember this code? It's on page 2. Is there anyway to break down the replacement text and set to difference size? Just like in your code, s="Not Fun", how to make "Not" to size 16, and "Fun" to size 10. The condition is the "Not" in one row, and the "Fun" in another row.
ThanksComment
-
Originally posted by joemo2003Sam, do you still remember this code? It's on page 2. Is there anyway to break down the replacement text and set to difference size? Just like in your code, s="Not Fun", how to make "Not" to size 16, and "Fun" to size 10. The condition is the "Not" in one row, and the "Fun" in another row.
ThanksComment
-
Originally posted by SammyBSo, you want the first row of text to be 16 and the second row to be 10 for all of your Visio shapes? In that case, I would just iterate through all of the Visio shapes after you've done the replacement.Comment
Comment