Sdtcontentdropdownlist,打开XML,C# [英] Sdtcontentdropdownlist, open XML, C#

查看:90
本文介绍了Sdtcontentdropdownlist,打开XML,C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Open XML,C#从.docx读取SdtContentDropDownList字段中的用户选择值,还能告诉我,我们如何在c#,OpenXML中使用DocumentFormat.OpenXml.Wordprocessing.DropDownListSelection



我尝试过:



  //  读取控制值 
string firstname1 = sdtA.SdtContentCell.ElementAt( 0 )。InnerText;

// SdtContentDropDownList ddl = new SdtContentDropDownList();

// ddl.LastValue.Value;

解决方案

就像理查德所说,你需要查看文档,了解你要做的事情。



Google需要成为你的朋友:



DocumentFormat.OpenXml.Wordprocessing.DropDownListSelection - Google搜索 [ ^ ]



< a href =https://msdn.microsoft.com/en-us/library/documentformat.openxml.wordproc essing.dropdownlistselection(v = office.14).aspx> DropDownListSelection类(DocumentFormat.OpenXml.Wordprocessing) [ ^ ]



你真的需要学习如何通过谷歌/任何其他资源研究你的问题,因为你可能已经节省了很多时间,而不是等待互联网上的陌生人给你那些相同的链接。



现在,一旦你开始研究这个问题,你是否应该被困在某个地方......随时回过头来清楚地解释你的问题以及任何相关的代码示例,以便我们复制你的问题。 / BLOCKQUOTE>

I have the requirement to read user selected value from SdtContentDropDownList field from .docx using Open XML, C# and also can you please tell me, how can we use DocumentFormat.OpenXml.Wordprocessing.DropDownListSelection in c#, OpenXML

What I have tried:

//To Read Control Value
                        string firstname1 = sdtA.SdtContentCell.ElementAt(0).InnerText;

                        // SdtContentDropDownList ddl = new SdtContentDropDownList();

                        //ddl.LastValue.Value;

解决方案

Like richard said, you need to review the documentation for what you are trying to do.

Google needs to become your friend:

DocumentFormat.OpenXml.Wordprocessing.DropDownListSelection - Google Search[^]

DropDownListSelection Class (DocumentFormat.OpenXml.Wordprocessing)[^]

You really need to learn how to research your issues via google/any other resource as you could have likely saved yourself a lot of time rather than waiting for strangers on the internet to give you those same links.

Now, once you start working on this and should you get stuck somewhere...feel free to come back with a clear explanation of your issue and any relevant code samples for us to replicate your problem.


这篇关于Sdtcontentdropdownlist,打开XML,C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆