How to get images from the user selection in word add-in?How do you display code snippets in MS Word preserving format and syntax highlighting?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?How do I update the GUI from another thread?Get int value from enum in C#Get property value from string using reflection in C#Detecting text changes in Word 2016 from VSTO add-inHow to prevent combobox firing event when we typing textHow to replace text with a MS Word web add-in by preserving the formatting?Word VBA gets runtime Error 91 with using range.find in Word HeaderC# Word Document, replace selected Range text?
Replacing matching entries in one column of a file by another column from a different file
Is it possible to run Internet Explorer on OS X El Capitan?
Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?
Is it inappropriate for a student to attend their mentor's dissertation defense?
Can I ask the recruiters in my resume to put the reason why I am rejected?
Can a vampire attack twice with their claws using Multiattack?
What's that red-plus icon near a text?
I'm flying to France today and my passport expires in less than 2 months
Why is 150k or 200k jobs considered good when there's 300k+ births a month?
What's the output of a record needle playing an out-of-speed record
What is a clear way to write a bar that has an extra beat?
Do infinite dimensional systems make sense?
Could an aircraft fly or hover using only jets of compressed air?
How is it possible to have an ability score that is less than 3?
Convert two switches to a dual stack, and add outlet - possible here?
How can bays and straits be determined in a procedurally generated map?
Why is consensus so controversial in Britain?
LaTeX: Why are digits allowed in environments, but forbidden in commands?
NMaximize is not converging to a solution
How old can references or sources in a thesis be?
Why does Kotter return in Welcome Back Kotter?
What does "Puller Prush Person" mean?
Malformed Address '10.10.21.08/24', must be X.X.X.X/NN or
infared filters v nd
How to get images from the user selection in word add-in?
How do you display code snippets in MS Word preserving format and syntax highlighting?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?How do I update the GUI from another thread?Get int value from enum in C#Get property value from string using reflection in C#Detecting text changes in Word 2016 from VSTO add-inHow to prevent combobox firing event when we typing textHow to replace text with a MS Word web add-in by preserving the formatting?Word VBA gets runtime Error 91 with using range.find in Word HeaderC# Word Document, replace selected Range text?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I need to get the text and images that are selected from the word document. I’m able to get the selected text in the document selection change event. For images I can get the count of selected images but couldn't get either the URL of the image or the byte array of the image.
Below is the method I have used
void ThisDocument_SelectionChange(object sender, Microsoft.Office.Tools.Word.SelectionEventArgs e)
int imageCount = e.Selection.InlineShapes.Count;
if (imageCount > 0)
//Error occurred: Collection doesn’t exist
var img = e.Selection.InlineShapes[0];
System.Windows.Forms.MessageBox.Show("Title" + ss.Title);
if (!string.IsNullOrEmpty(e.Selection.Text))
System.Windows.Forms.MessageBox.Show("The selection in the document has changed." + e.Selection.Text);
How can I resolve this?
c# ms-word add-in
add a comment |
I need to get the text and images that are selected from the word document. I’m able to get the selected text in the document selection change event. For images I can get the count of selected images but couldn't get either the URL of the image or the byte array of the image.
Below is the method I have used
void ThisDocument_SelectionChange(object sender, Microsoft.Office.Tools.Word.SelectionEventArgs e)
int imageCount = e.Selection.InlineShapes.Count;
if (imageCount > 0)
//Error occurred: Collection doesn’t exist
var img = e.Selection.InlineShapes[0];
System.Windows.Forms.MessageBox.Show("Title" + ss.Title);
if (!string.IsNullOrEmpty(e.Selection.Text))
System.Windows.Forms.MessageBox.Show("The selection in the document has changed." + e.Selection.Text);
How can I resolve this?
c# ms-word add-in
DoesInlineShape.Range.EnhMetaFileBits
help? It's that, or copy to the clipboard then take it from the clipboard in the format you need.
– Cindy Meister
Jun 22 '18 at 10:18
var inlineShapeObj = e.Selection.InlineShapes[0]; //Above line I'm trying to get the InlineShape from InlineShape collection.But error occured "The requested member of the collection does not exist." var imgByte = inlineShapeObj.Range.EnhMetaFileBits;
– Naveen Prasath
Jun 22 '18 at 11:43
Are you sure it's an InlineShape and not a Shape?
– Cindy Meister
Jun 22 '18 at 12:09
add a comment |
I need to get the text and images that are selected from the word document. I’m able to get the selected text in the document selection change event. For images I can get the count of selected images but couldn't get either the URL of the image or the byte array of the image.
Below is the method I have used
void ThisDocument_SelectionChange(object sender, Microsoft.Office.Tools.Word.SelectionEventArgs e)
int imageCount = e.Selection.InlineShapes.Count;
if (imageCount > 0)
//Error occurred: Collection doesn’t exist
var img = e.Selection.InlineShapes[0];
System.Windows.Forms.MessageBox.Show("Title" + ss.Title);
if (!string.IsNullOrEmpty(e.Selection.Text))
System.Windows.Forms.MessageBox.Show("The selection in the document has changed." + e.Selection.Text);
How can I resolve this?
c# ms-word add-in
I need to get the text and images that are selected from the word document. I’m able to get the selected text in the document selection change event. For images I can get the count of selected images but couldn't get either the URL of the image or the byte array of the image.
Below is the method I have used
void ThisDocument_SelectionChange(object sender, Microsoft.Office.Tools.Word.SelectionEventArgs e)
int imageCount = e.Selection.InlineShapes.Count;
if (imageCount > 0)
//Error occurred: Collection doesn’t exist
var img = e.Selection.InlineShapes[0];
System.Windows.Forms.MessageBox.Show("Title" + ss.Title);
if (!string.IsNullOrEmpty(e.Selection.Text))
System.Windows.Forms.MessageBox.Show("The selection in the document has changed." + e.Selection.Text);
How can I resolve this?
c# ms-word add-in
c# ms-word add-in
edited Mar 9 at 0:52
halfer
14.7k759116
14.7k759116
asked Jun 22 '18 at 7:33
Naveen PrasathNaveen Prasath
389117
389117
DoesInlineShape.Range.EnhMetaFileBits
help? It's that, or copy to the clipboard then take it from the clipboard in the format you need.
– Cindy Meister
Jun 22 '18 at 10:18
var inlineShapeObj = e.Selection.InlineShapes[0]; //Above line I'm trying to get the InlineShape from InlineShape collection.But error occured "The requested member of the collection does not exist." var imgByte = inlineShapeObj.Range.EnhMetaFileBits;
– Naveen Prasath
Jun 22 '18 at 11:43
Are you sure it's an InlineShape and not a Shape?
– Cindy Meister
Jun 22 '18 at 12:09
add a comment |
DoesInlineShape.Range.EnhMetaFileBits
help? It's that, or copy to the clipboard then take it from the clipboard in the format you need.
– Cindy Meister
Jun 22 '18 at 10:18
var inlineShapeObj = e.Selection.InlineShapes[0]; //Above line I'm trying to get the InlineShape from InlineShape collection.But error occured "The requested member of the collection does not exist." var imgByte = inlineShapeObj.Range.EnhMetaFileBits;
– Naveen Prasath
Jun 22 '18 at 11:43
Are you sure it's an InlineShape and not a Shape?
– Cindy Meister
Jun 22 '18 at 12:09
Does
InlineShape.Range.EnhMetaFileBits
help? It's that, or copy to the clipboard then take it from the clipboard in the format you need.– Cindy Meister
Jun 22 '18 at 10:18
Does
InlineShape.Range.EnhMetaFileBits
help? It's that, or copy to the clipboard then take it from the clipboard in the format you need.– Cindy Meister
Jun 22 '18 at 10:18
var inlineShapeObj = e.Selection.InlineShapes[0]; //Above line I'm trying to get the InlineShape from InlineShape collection.But error occured "The requested member of the collection does not exist." var imgByte = inlineShapeObj.Range.EnhMetaFileBits;
– Naveen Prasath
Jun 22 '18 at 11:43
var inlineShapeObj = e.Selection.InlineShapes[0]; //Above line I'm trying to get the InlineShape from InlineShape collection.But error occured "The requested member of the collection does not exist." var imgByte = inlineShapeObj.Range.EnhMetaFileBits;
– Naveen Prasath
Jun 22 '18 at 11:43
Are you sure it's an InlineShape and not a Shape?
– Cindy Meister
Jun 22 '18 at 12:09
Are you sure it's an InlineShape and not a Shape?
– Cindy Meister
Jun 22 '18 at 12:09
add a comment |
0
active
oldest
votes
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%2f50982897%2fhow-to-get-images-from-the-user-selection-in-word-add-in%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
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%2f50982897%2fhow-to-get-images-from-the-user-selection-in-word-add-in%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
Does
InlineShape.Range.EnhMetaFileBits
help? It's that, or copy to the clipboard then take it from the clipboard in the format you need.– Cindy Meister
Jun 22 '18 at 10:18
var inlineShapeObj = e.Selection.InlineShapes[0]; //Above line I'm trying to get the InlineShape from InlineShape collection.But error occured "The requested member of the collection does not exist." var imgByte = inlineShapeObj.Range.EnhMetaFileBits;
– Naveen Prasath
Jun 22 '18 at 11:43
Are you sure it's an InlineShape and not a Shape?
– Cindy Meister
Jun 22 '18 at 12:09