A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Visio
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Creating Macro in Visio 2007



 
 
Thread Tools Display Modes
  #1  
Old July 7th, 2009, 07:20 AM posted to microsoft.public.visio.general
Puzzled MS User
external usenet poster
 
Posts: 5
Default Creating Macro in Visio 2007

I want to record a macro in Visio 2007 to paste unformatted text (Paste
Special Unformatted Text). I can record it okay and assign to the keyboard
but it won't work if I try to use it? I have tried to edit the macro with
the VB mark-up using a similar macro created in MS Word:

Sub PasteText()
'
' PasteText Macro
On Error GoTo ErrorHandler
Selection.PasteSpecial DataType:=wdPasteText
Exit Sub
ErrorHandler:
Beep
End Sub

But this just gives an error beep.

Also - how do I do the following:

1) Create it so it works on all Visio documents not just the one I'm in when
recording it?
2) Assign it to a toolbar button (I have tried to Customise toolbars but
there is no option to add a macro and I can't move it from "Tools Macro
NewMacro PasteText" as only an option appears for Macro List rather than
the actual list of macros?

Any help is appreciated.
  #2  
Old July 7th, 2009, 11:47 AM posted to microsoft.public.visio.general
AlEdlund
external usenet poster
 
Posts: 468
Default Creating Macro in Visio 2007

The first one sounds like security is set to not allow macros to run.

"1) Create it so it works on all Visio documents not just the one I'm in
when
recording it?" Save the blank drawing (with the macro) as a template and
call it as your standard document.

"2) Assign it to a toolbar button (I have tried to Customise toolbars but
there is no option to add a macro and I can't move it from "Tools Macro
NewMacro PasteText" as only an option appears for Macro List rather than
the actual list of macros?" That also has to be accomplished with custom
code,

http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

al


"Puzzled MS User" wrote in message
...
I want to record a macro in Visio 2007 to paste unformatted text (Paste
Special Unformatted Text). I can record it okay and assign to the
keyboard
but it won't work if I try to use it? I have tried to edit the macro with
the VB mark-up using a similar macro created in MS Word:

Sub PasteText()
'
' PasteText Macro
On Error GoTo ErrorHandler
Selection.PasteSpecial DataType:=wdPasteText
Exit Sub
ErrorHandler:
Beep
End Sub

But this just gives an error beep.

Also - how do I do the following:

1) Create it so it works on all Visio documents not just the one I'm in
when
recording it?
2) Assign it to a toolbar button (I have tried to Customise toolbars but
there is no option to add a macro and I can't move it from "Tools Macro

NewMacro PasteText" as only an option appears for Macro List rather than
the actual list of macros?

Any help is appreciated.


  #3  
Old July 8th, 2009, 05:25 AM posted to microsoft.public.visio.general
Puzzled MS User
external usenet poster
 
Posts: 5
Default Creating Macro in Visio 2007

I just checked the security settings and it was on "Disable all macros with
notification" (I didn't get a notification when trying to use macro), so I
changed it to "Enable all macros" but it still didn't work. When I view the
macro in VBA mode it only has:

Sub PasteText()
'
' Paste Unformatted Text
'
' Keyboard Shortcut: Ctrl+Shift+G
'
End Sub

Paste Unformatted Text is the description I gave it so it appears to not be
recording anything. Do you know what the coding should be to Paste Special
Unformatted Text?

I tried to use that link you gave but I couldn't understand where I was
supposed to look as it just took me to the contents page. I scanned the
Chapter 15 section on Programming Visio with VBA?? but most of it is geared
towards creating macros for shapes etc.

Any other help would be greatly appreciated.

Thanks

"AlEdlund" wrote:

The first one sounds like security is set to not allow macros to run.

"1) Create it so it works on all Visio documents not just the one I'm in
when
recording it?" Save the blank drawing (with the macro) as a template and
call it as your standard document.

"2) Assign it to a toolbar button (I have tried to Customise toolbars but
there is no option to add a macro and I can't move it from "Tools Macro
NewMacro PasteText" as only an option appears for Macro List rather than
the actual list of macros?" That also has to be accomplished with custom
code,

http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

al


"Puzzled MS User" wrote in message
...
I want to record a macro in Visio 2007 to paste unformatted text (Paste
Special Unformatted Text). I can record it okay and assign to the
keyboard
but it won't work if I try to use it? I have tried to edit the macro with
the VB mark-up using a similar macro created in MS Word:

Sub PasteText()
'
' PasteText Macro
On Error GoTo ErrorHandler
Selection.PasteSpecial DataType:=wdPasteText
Exit Sub
ErrorHandler:
Beep
End Sub

But this just gives an error beep.

Also - how do I do the following:

1) Create it so it works on all Visio documents not just the one I'm in
when
recording it?
2) Assign it to a toolbar button (I have tried to Customise toolbars but
there is no option to add a macro and I can't move it from "Tools Macro

NewMacro PasteText" as only an option appears for Macro List rather than
the actual list of macros?

Any help is appreciated.


  #4  
Old July 8th, 2009, 02:33 PM posted to microsoft.public.visio.general
AlEdlund
external usenet poster
 
Posts: 468
Default Creating Macro in Visio 2007

The macro you are attempting to emulate, pastes text into a selection in
word. Visio has a lot more options on where you might paste text...
Consider this...
Open VBA
Select Microsoft Visual Basic help
' why you have to come to the vba tool to find this is beyond me
Select Visio Automation Object Model Reference
Enter Paste Text in search pane

al



"Puzzled MS User" wrote in message
...
I just checked the security settings and it was on "Disable all macros
with
notification" (I didn't get a notification when trying to use macro), so I
changed it to "Enable all macros" but it still didn't work. When I view
the
macro in VBA mode it only has:

Sub PasteText()
'
' Paste Unformatted Text
'
' Keyboard Shortcut: Ctrl+Shift+G
'
End Sub

Paste Unformatted Text is the description I gave it so it appears to not
be
recording anything. Do you know what the coding should be to Paste
Special
Unformatted Text?

I tried to use that link you gave but I couldn't understand where I was
supposed to look as it just took me to the contents page. I scanned the
Chapter 15 section on Programming Visio with VBA?? but most of it is
geared
towards creating macros for shapes etc.

Any other help would be greatly appreciated.

Thanks

"AlEdlund" wrote:

The first one sounds like security is set to not allow macros to run.

"1) Create it so it works on all Visio documents not just the one I'm in
when
recording it?" Save the blank drawing (with the macro) as a template and
call it as your standard document.

"2) Assign it to a toolbar button (I have tried to Customise toolbars but
there is no option to add a macro and I can't move it from "Tools Macro

NewMacro PasteText" as only an option appears for Macro List rather
than
the actual list of macros?" That also has to be accomplished with custom
code,

http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

al


"Puzzled MS User" wrote in
message
...
I want to record a macro in Visio 2007 to paste unformatted text (Paste
Special Unformatted Text). I can record it okay and assign to the
keyboard
but it won't work if I try to use it? I have tried to edit the macro
with
the VB mark-up using a similar macro created in MS Word:

Sub PasteText()
'
' PasteText Macro
On Error GoTo ErrorHandler
Selection.PasteSpecial DataType:=wdPasteText
Exit Sub
ErrorHandler:
Beep
End Sub

But this just gives an error beep.

Also - how do I do the following:

1) Create it so it works on all Visio documents not just the one I'm in
when
recording it?
2) Assign it to a toolbar button (I have tried to Customise toolbars
but
there is no option to add a macro and I can't move it from "Tools
Macro

NewMacro PasteText" as only an option appears for Macro List rather
than
the actual list of macros?

Any help is appreciated.


  #5  
Old July 9th, 2009, 12:58 AM posted to microsoft.public.visio.general
Puzzled MS User
external usenet poster
 
Posts: 5
Default Creating Macro in Visio 2007

Just to address your post this is what I was trying to do: I have visio pages
full of shapes/text boxes that all link wonderfully as a conceptual map (in
different colours/fonts, etc.) but I want to copy the text from the boxes
onto another page in a vertical outline format, without having to go Paste
Special Unformatted Text OK, all the time. I tried to record a macro
using the simple record, perform the steps, stop button action (without using
VBA as you can clearly tell I'm no good at it), but when it comes to using
the macro, nothing happens.

I recorded a similar macro in MS Word and for some reason MS/Macro tool??
didn't acknowledge the "unformatted text" option being selected and kept
pasting the format, so I jumped onto these forums and some lovely MVPs
provided the VBA language and instructions on how to edit the macro to make
the unformatted text macro work... all good. I thus tried to replicate the
similar action in MS Visio (silly me thought all MS programs were
similar...), but when I edited the macro I noticed there was nothing within
it - thus why the macro didn't work. I tried to use the Word VBA as you
noticed but as I said, it didn't work and I wanted to ask what the Visio
equivalent was. I'm assuming you don't know and the help links you gave me
are not helping either.

As I'm writing this, I'm now thinking the outline would be better in
Word/Excel - which I know how to use and have set up macros which work. I
just added this post to address the "why you have to come to the vba tool to
find this is beyond me" comment you noted below.

Have a nice day and thanks for trying...

"AlEdlund" wrote:

The macro you are attempting to emulate, pastes text into a selection in
word. Visio has a lot more options on where you might paste text...
Consider this...
Open VBA
Select Microsoft Visual Basic help
' why you have to come to the vba tool to find this is beyond me
Select Visio Automation Object Model Reference
Enter Paste Text in search pane

al



"Puzzled MS User" wrote in message
...
I just checked the security settings and it was on "Disable all macros
with
notification" (I didn't get a notification when trying to use macro), so I
changed it to "Enable all macros" but it still didn't work. When I view
the
macro in VBA mode it only has:

Sub PasteText()
'
' Paste Unformatted Text
'
' Keyboard Shortcut: Ctrl+Shift+G
'
End Sub

Paste Unformatted Text is the description I gave it so it appears to not
be
recording anything. Do you know what the coding should be to Paste
Special
Unformatted Text?

I tried to use that link you gave but I couldn't understand where I was
supposed to look as it just took me to the contents page. I scanned the
Chapter 15 section on Programming Visio with VBA?? but most of it is
geared
towards creating macros for shapes etc.

Any other help would be greatly appreciated.

Thanks

"AlEdlund" wrote:

The first one sounds like security is set to not allow macros to run.

"1) Create it so it works on all Visio documents not just the one I'm in
when
recording it?" Save the blank drawing (with the macro) as a template and
call it as your standard document.

"2) Assign it to a toolbar button (I have tried to Customise toolbars but
there is no option to add a macro and I can't move it from "Tools Macro

NewMacro PasteText" as only an option appears for Macro List rather
than
the actual list of macros?" That also has to be accomplished with custom
code,

http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

al


"Puzzled MS User" wrote in
message
...
I want to record a macro in Visio 2007 to paste unformatted text (Paste
Special Unformatted Text). I can record it okay and assign to the
keyboard
but it won't work if I try to use it? I have tried to edit the macro
with
the VB mark-up using a similar macro created in MS Word:

Sub PasteText()
'
' PasteText Macro
On Error GoTo ErrorHandler
Selection.PasteSpecial DataType:=wdPasteText
Exit Sub
ErrorHandler:
Beep
End Sub

But this just gives an error beep.

Also - how do I do the following:

1) Create it so it works on all Visio documents not just the one I'm in
when
recording it?
2) Assign it to a toolbar button (I have tried to Customise toolbars
but
there is no option to add a macro and I can't move it from "Tools
Macro

NewMacro PasteText" as only an option appears for Macro List rather
than
the actual list of macros?

Any help is appreciated.

  #6  
Old July 9th, 2009, 02:45 AM posted to microsoft.public.visio.general
AlEdlund
external usenet poster
 
Posts: 468
Default Creating Macro in Visio 2007

Given that piece of insight I'd probably have suggested that you consider
looking at the tools function and see if one of the prebuilt report options
might have helped. The reason I say that is that is because the process
you're attempting appears at the surface to have an implied 'append to
existing text' impact that I did not understand from you original post.

al


"Puzzled MS User" wrote in message
...
Just to address your post this is what I was trying to do: I have visio
pages
full of shapes/text boxes that all link wonderfully as a conceptual map
(in
different colours/fonts, etc.) but I want to copy the text from the boxes
onto another page in a vertical outline format, without having to go Paste
Special Unformatted Text OK, all the time. I tried to record a macro
using the simple record, perform the steps, stop button action (without
using
VBA as you can clearly tell I'm no good at it), but when it comes to using
the macro, nothing happens.

I recorded a similar macro in MS Word and for some reason MS/Macro tool??
didn't acknowledge the "unformatted text" option being selected and kept
pasting the format, so I jumped onto these forums and some lovely MVPs
provided the VBA language and instructions on how to edit the macro to
make
the unformatted text macro work... all good. I thus tried to replicate
the
similar action in MS Visio (silly me thought all MS programs were
similar...), but when I edited the macro I noticed there was nothing
within
it - thus why the macro didn't work. I tried to use the Word VBA as you
noticed but as I said, it didn't work and I wanted to ask what the Visio
equivalent was. I'm assuming you don't know and the help links you gave
me
are not helping either.

As I'm writing this, I'm now thinking the outline would be better in
Word/Excel - which I know how to use and have set up macros which work. I
just added this post to address the "why you have to come to the vba tool
to
find this is beyond me" comment you noted below.

Have a nice day and thanks for trying...

"AlEdlund" wrote:

The macro you are attempting to emulate, pastes text into a selection in
word. Visio has a lot more options on where you might paste text...
Consider this...
Open VBA
Select Microsoft Visual Basic help
' why you have to come to the vba tool to find this is beyond me
Select Visio Automation Object Model Reference
Enter Paste Text in search pane

al



"Puzzled MS User" wrote in
message
...
I just checked the security settings and it was on "Disable all macros
with
notification" (I didn't get a notification when trying to use macro),
so I
changed it to "Enable all macros" but it still didn't work. When I
view
the
macro in VBA mode it only has:

Sub PasteText()
'
' Paste Unformatted Text
'
' Keyboard Shortcut: Ctrl+Shift+G
'
End Sub

Paste Unformatted Text is the description I gave it so it appears to
not
be
recording anything. Do you know what the coding should be to Paste
Special
Unformatted Text?

I tried to use that link you gave but I couldn't understand where I was
supposed to look as it just took me to the contents page. I scanned
the
Chapter 15 section on Programming Visio with VBA?? but most of it is
geared
towards creating macros for shapes etc.

Any other help would be greatly appreciated.

Thanks

"AlEdlund" wrote:

The first one sounds like security is set to not allow macros to run.

"1) Create it so it works on all Visio documents not just the one I'm
in
when
recording it?" Save the blank drawing (with the macro) as a template
and
call it as your standard document.

"2) Assign it to a toolbar button (I have tried to Customise toolbars
but
there is no option to add a macro and I can't move it from "Tools
Macro

NewMacro PasteText" as only an option appears for Macro List rather
than
the actual list of macros?" That also has to be accomplished with
custom
code,

http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

al


"Puzzled MS User" wrote in
message
...
I want to record a macro in Visio 2007 to paste unformatted text
(Paste
Special Unformatted Text). I can record it okay and assign to the
keyboard
but it won't work if I try to use it? I have tried to edit the
macro
with
the VB mark-up using a similar macro created in MS Word:

Sub PasteText()
'
' PasteText Macro
On Error GoTo ErrorHandler
Selection.PasteSpecial DataType:=wdPasteText
Exit Sub
ErrorHandler:
Beep
End Sub

But this just gives an error beep.

Also - how do I do the following:

1) Create it so it works on all Visio documents not just the one I'm
in
when
recording it?
2) Assign it to a toolbar button (I have tried to Customise toolbars
but
there is no option to add a macro and I can't move it from "Tools
Macro

NewMacro PasteText" as only an option appears for Macro List
rather
than
the actual list of macros?

Any help is appreciated.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.