How can I paste a Visio drawing directly into PowerPoint without losing editing ability or formatting?
Long story short, I am writing a program that copies a series of Visio drawings and pastes each of them onto a PowerPoint slide for a client. This is very simple to do manually (Copy entire drawing in Visio, navigate to PowerPoint, paste special, -> Microsoft Visio Drawing Object) but I cannot find a way to automate this.
Windows Metafile and Enhanced Metafile are not acceptable because the moment you ungroup the image for purposes of editing, the pretty Visio formatting falls apart.
Normally I'd attempt to record a macro in PowerPoint and paste the image to see the code it produces, but PowerPoint no longer has the capability to record macros. I tried the same in Excel, but that line of code
ActiveSheet.PasteSpecial Format:="Microsoft Visio Document", Link:=False, DisplayAsIcon:=False
does not appear to be adaptable to my case due to differences in the PowerPoint PasteSpecial function and the Excel PasteSpecial function.
Here is the relevant code snippet I am working with.
' Select all and copy each Visio page
pg.CreateSelection(visSelTypeAll).Copy
' Paste special to each ppt slide, size and position properly
pptApp.ActiveWindow.View.GotoSlide (i)
pptApp.ActiveWindow.View.PasteSpecial DataType:=ppPasteOLEObject, Link:=False, DisplayAsIcon:=False
I've tried every DataType that appears to be available to that paste function, but I presume there must be another way to do it.
Please let me know if there is any additional information that may be relevant. I'm fairly new to this kind of programming.
Thanks in advance!
vba powerpoint powerpoint-vba visio visio-vba
add a comment |
Long story short, I am writing a program that copies a series of Visio drawings and pastes each of them onto a PowerPoint slide for a client. This is very simple to do manually (Copy entire drawing in Visio, navigate to PowerPoint, paste special, -> Microsoft Visio Drawing Object) but I cannot find a way to automate this.
Windows Metafile and Enhanced Metafile are not acceptable because the moment you ungroup the image for purposes of editing, the pretty Visio formatting falls apart.
Normally I'd attempt to record a macro in PowerPoint and paste the image to see the code it produces, but PowerPoint no longer has the capability to record macros. I tried the same in Excel, but that line of code
ActiveSheet.PasteSpecial Format:="Microsoft Visio Document", Link:=False, DisplayAsIcon:=False
does not appear to be adaptable to my case due to differences in the PowerPoint PasteSpecial function and the Excel PasteSpecial function.
Here is the relevant code snippet I am working with.
' Select all and copy each Visio page
pg.CreateSelection(visSelTypeAll).Copy
' Paste special to each ppt slide, size and position properly
pptApp.ActiveWindow.View.GotoSlide (i)
pptApp.ActiveWindow.View.PasteSpecial DataType:=ppPasteOLEObject, Link:=False, DisplayAsIcon:=False
I've tried every DataType that appears to be available to that paste function, but I presume there must be another way to do it.
Please let me know if there is any additional information that may be relevant. I'm fairly new to this kind of programming.
Thanks in advance!
vba powerpoint powerpoint-vba visio visio-vba
add a comment |
Long story short, I am writing a program that copies a series of Visio drawings and pastes each of them onto a PowerPoint slide for a client. This is very simple to do manually (Copy entire drawing in Visio, navigate to PowerPoint, paste special, -> Microsoft Visio Drawing Object) but I cannot find a way to automate this.
Windows Metafile and Enhanced Metafile are not acceptable because the moment you ungroup the image for purposes of editing, the pretty Visio formatting falls apart.
Normally I'd attempt to record a macro in PowerPoint and paste the image to see the code it produces, but PowerPoint no longer has the capability to record macros. I tried the same in Excel, but that line of code
ActiveSheet.PasteSpecial Format:="Microsoft Visio Document", Link:=False, DisplayAsIcon:=False
does not appear to be adaptable to my case due to differences in the PowerPoint PasteSpecial function and the Excel PasteSpecial function.
Here is the relevant code snippet I am working with.
' Select all and copy each Visio page
pg.CreateSelection(visSelTypeAll).Copy
' Paste special to each ppt slide, size and position properly
pptApp.ActiveWindow.View.GotoSlide (i)
pptApp.ActiveWindow.View.PasteSpecial DataType:=ppPasteOLEObject, Link:=False, DisplayAsIcon:=False
I've tried every DataType that appears to be available to that paste function, but I presume there must be another way to do it.
Please let me know if there is any additional information that may be relevant. I'm fairly new to this kind of programming.
Thanks in advance!
vba powerpoint powerpoint-vba visio visio-vba
Long story short, I am writing a program that copies a series of Visio drawings and pastes each of them onto a PowerPoint slide for a client. This is very simple to do manually (Copy entire drawing in Visio, navigate to PowerPoint, paste special, -> Microsoft Visio Drawing Object) but I cannot find a way to automate this.
Windows Metafile and Enhanced Metafile are not acceptable because the moment you ungroup the image for purposes of editing, the pretty Visio formatting falls apart.
Normally I'd attempt to record a macro in PowerPoint and paste the image to see the code it produces, but PowerPoint no longer has the capability to record macros. I tried the same in Excel, but that line of code
ActiveSheet.PasteSpecial Format:="Microsoft Visio Document", Link:=False, DisplayAsIcon:=False
does not appear to be adaptable to my case due to differences in the PowerPoint PasteSpecial function and the Excel PasteSpecial function.
Here is the relevant code snippet I am working with.
' Select all and copy each Visio page
pg.CreateSelection(visSelTypeAll).Copy
' Paste special to each ppt slide, size and position properly
pptApp.ActiveWindow.View.GotoSlide (i)
pptApp.ActiveWindow.View.PasteSpecial DataType:=ppPasteOLEObject, Link:=False, DisplayAsIcon:=False
I've tried every DataType that appears to be available to that paste function, but I presume there must be another way to do it.
Please let me know if there is any additional information that may be relevant. I'm fairly new to this kind of programming.
Thanks in advance!
vba powerpoint powerpoint-vba visio visio-vba
vba powerpoint powerpoint-vba visio visio-vba
asked Nov 19 '18 at 14:45
Christopher K
1
1
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
After some time, this appears to be my best answer:
' Select all and copy each Visio page
pg.CreateSelection(visSelTypeAll).Copy
' Paste special to each ppt slide, size and position properly
pptApp.ActiveWindow.View.GotoSlide (i)
pptApp.CommandBars.ExecuteMso "PasteSpecialDialog"
SendKeys "{ENTER}", True
This uses CommandBars.ExecuteMso to manually activate the paste special dialog and sends an Enter key press to select the first option.
Now I'm dealing with a "there isn't enough memory to perform the operation" error for my more complicated Visio drawings. But that's a different problem entirely :)
1
What's the purpose of having the drawings editable from within Powerpoint? Wouldn't it make the workflow easier and lighter if you just past pictures of the originals?
– y4cine
Nov 20 '18 at 7:47
The drawings are very much subject to change by the client. If they were pasted as images then the workflow for them to update the drawings in their preferred format would be more onerous
– Christopher K
Nov 20 '18 at 14:13
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53377050%2fhow-can-i-paste-a-visio-drawing-directly-into-powerpoint-without-losing-editing%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
After some time, this appears to be my best answer:
' Select all and copy each Visio page
pg.CreateSelection(visSelTypeAll).Copy
' Paste special to each ppt slide, size and position properly
pptApp.ActiveWindow.View.GotoSlide (i)
pptApp.CommandBars.ExecuteMso "PasteSpecialDialog"
SendKeys "{ENTER}", True
This uses CommandBars.ExecuteMso to manually activate the paste special dialog and sends an Enter key press to select the first option.
Now I'm dealing with a "there isn't enough memory to perform the operation" error for my more complicated Visio drawings. But that's a different problem entirely :)
1
What's the purpose of having the drawings editable from within Powerpoint? Wouldn't it make the workflow easier and lighter if you just past pictures of the originals?
– y4cine
Nov 20 '18 at 7:47
The drawings are very much subject to change by the client. If they were pasted as images then the workflow for them to update the drawings in their preferred format would be more onerous
– Christopher K
Nov 20 '18 at 14:13
add a comment |
After some time, this appears to be my best answer:
' Select all and copy each Visio page
pg.CreateSelection(visSelTypeAll).Copy
' Paste special to each ppt slide, size and position properly
pptApp.ActiveWindow.View.GotoSlide (i)
pptApp.CommandBars.ExecuteMso "PasteSpecialDialog"
SendKeys "{ENTER}", True
This uses CommandBars.ExecuteMso to manually activate the paste special dialog and sends an Enter key press to select the first option.
Now I'm dealing with a "there isn't enough memory to perform the operation" error for my more complicated Visio drawings. But that's a different problem entirely :)
1
What's the purpose of having the drawings editable from within Powerpoint? Wouldn't it make the workflow easier and lighter if you just past pictures of the originals?
– y4cine
Nov 20 '18 at 7:47
The drawings are very much subject to change by the client. If they were pasted as images then the workflow for them to update the drawings in their preferred format would be more onerous
– Christopher K
Nov 20 '18 at 14:13
add a comment |
After some time, this appears to be my best answer:
' Select all and copy each Visio page
pg.CreateSelection(visSelTypeAll).Copy
' Paste special to each ppt slide, size and position properly
pptApp.ActiveWindow.View.GotoSlide (i)
pptApp.CommandBars.ExecuteMso "PasteSpecialDialog"
SendKeys "{ENTER}", True
This uses CommandBars.ExecuteMso to manually activate the paste special dialog and sends an Enter key press to select the first option.
Now I'm dealing with a "there isn't enough memory to perform the operation" error for my more complicated Visio drawings. But that's a different problem entirely :)
After some time, this appears to be my best answer:
' Select all and copy each Visio page
pg.CreateSelection(visSelTypeAll).Copy
' Paste special to each ppt slide, size and position properly
pptApp.ActiveWindow.View.GotoSlide (i)
pptApp.CommandBars.ExecuteMso "PasteSpecialDialog"
SendKeys "{ENTER}", True
This uses CommandBars.ExecuteMso to manually activate the paste special dialog and sends an Enter key press to select the first option.
Now I'm dealing with a "there isn't enough memory to perform the operation" error for my more complicated Visio drawings. But that's a different problem entirely :)
answered Nov 19 '18 at 19:39
Christopher K
1
1
1
What's the purpose of having the drawings editable from within Powerpoint? Wouldn't it make the workflow easier and lighter if you just past pictures of the originals?
– y4cine
Nov 20 '18 at 7:47
The drawings are very much subject to change by the client. If they were pasted as images then the workflow for them to update the drawings in their preferred format would be more onerous
– Christopher K
Nov 20 '18 at 14:13
add a comment |
1
What's the purpose of having the drawings editable from within Powerpoint? Wouldn't it make the workflow easier and lighter if you just past pictures of the originals?
– y4cine
Nov 20 '18 at 7:47
The drawings are very much subject to change by the client. If they were pasted as images then the workflow for them to update the drawings in their preferred format would be more onerous
– Christopher K
Nov 20 '18 at 14:13
1
1
What's the purpose of having the drawings editable from within Powerpoint? Wouldn't it make the workflow easier and lighter if you just past pictures of the originals?
– y4cine
Nov 20 '18 at 7:47
What's the purpose of having the drawings editable from within Powerpoint? Wouldn't it make the workflow easier and lighter if you just past pictures of the originals?
– y4cine
Nov 20 '18 at 7:47
The drawings are very much subject to change by the client. If they were pasted as images then the workflow for them to update the drawings in their preferred format would be more onerous
– Christopher K
Nov 20 '18 at 14:13
The drawings are very much subject to change by the client. If they were pasted as images then the workflow for them to update the drawings in their preferred format would be more onerous
– Christopher K
Nov 20 '18 at 14:13
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53377050%2fhow-can-i-paste-a-visio-drawing-directly-into-powerpoint-without-losing-editing%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown