Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8141507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:31:57+00:00 2026-06-06T12:31:57+00:00

In my project which I’m doing, I have to find if my word document

  • 0

In my project which I’m doing, I have to find if my word document consists of any image or table. Is there any way to do that using c# code. I couldn’t find any code related to this.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:31:59+00:00Added an answer on June 6, 2026 at 12:31 pm

    try bellow code…..

    Use Microsoft.Office.Interop
    

    This code work in asp.net and winforms, but I test it on Windows XP Pro, I don’t know it work on Windows Server

    using System;
    using System.Drawing;
    using System.IO;
    using System.Threading;
    using Microsoft.Office.Interop.Word;
    using Microsoft.VisualBasic.Devices;
    using Page=System.Web.UI.Page;
    
    public partial class DefaultPage : Page {
        private Application m_word;
        private int m_i;
    
        protected void Page_Load(object sender, EventArgs e) {
            object missing = Type.Missing;
            object fileName = "C:\\Test.docx";
            m_word = new Application();
            m_word.Documents.Open(ref fileName,
                                  ref missing, ref missing, ref missing, ref missing, ref missing,
                                  ref missing, ref missing, ref missing, ref missing, ref missing,
                                  ref missing, ref missing, ref missing, ref missing, ref missing);
    
            try {
                for (int i = 0; i < m_word.ActiveDocument.InlineShapes.Count; i++) {
                    m_i = i;
                    Thread thread = new Thread(CopyFromClipboardInlineShape);
                    thread.SetApartmentState(ApartmentState.STA);
                    thread.Start();
                    thread.Join();
                }
                for (int i = 0; i < m_word.ActiveDocument.Shapes.Count; i++) {
                    m_i = i;
                    Thread thread = new Thread(CopyFromClipboardShape);
                    thread.SetApartmentState(ApartmentState.STA);
                    thread.Start();
                    thread.Join();
                }
            }
            finally {
                object save = false;
                m_word.Quit(ref save, ref missing, ref missing);
                m_word = null;
            }
        }
    
        protected void CopyFromClipboardInlineShape() {
            InlineShape inlineShape = m_word.ActiveDocument.InlineShapes[m_i];
            inlineShape.Select();
            m_word.Selection.Copy();
            Computer computer = new Computer();
            Image img = computer.Clipboard.GetImage();
            /*...*/
        }
    
        protected void CopyFromClipboardShape() {
            object missing = Type.Missing;
            object i = m_i + 1;
            Shape shape = m_word.ActiveDocument.Shapes.get_Item(ref i);
            shape.Select(ref missing);
            m_word.Selection.Copy();
            Computer computer = new Computer();
            Image img = computer.Clipboard.GetImage();
            /*...*/
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project which is full of compile time errors? Is there is
I have a project which consists of several services, each in their own SVN
I have a .NET project which references another assembly that is built outside of
I'm developing project which use image processing technique. In that I'm using javacv package
I have a win32 project which is very complex and i successfully referenced that
I have a Lightswitch project which has an order table and an orderlines table.
For my Java project which uses Maven I have added Twitters Bootstrap lately to
I am doing a project which involves a good use of core data. I
I have a project which has some lib's associated with it (in Build Path).
I have a project which uses groovy 1.7.5 and grails 1.3.4. but my new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.