【问题标题】:How to make a hyperlink inside cell text?如何在单元格文本中创建超链接?
【发布时间】:2013-12-10 16:31:18
【问题描述】:

如何在 Excel 单元格中创建指向另一个页面或文档的超链接。 示例:

整个文本都在一个单元格内。但是我想让“FOGC-FP01”成为另一个页面或文档的超链接,并且“更新”一直是文本??

【问题讨论】:

    标签: excel hyperlink ms-word ms-office


    【解决方案1】:

    单击要创建超链接的单元格。转到插入>超链接。

    在弹出的窗口中使用place in this document

    戈登

    我认为只将单元格字符串的一部分设为超链接是不可能的。

    【讨论】:

      【解决方案2】:

      【讨论】:

        【解决方案3】:

        这是一个非常相似的例子,所以我希望它会有所帮助。

            static void Main(string[] args)
            {
                var xla = new Microsoft.Office.Interop.Excel.Application();
                var wbosszes = xla.Workbooks.Add(XlSheetType.xlWorksheet);
        
                Worksheet ws = (Worksheet)xla.ActiveSheet;
                ws.Name = "test";
        
                xla.Visible = true;
        
                List<Content> forExample = new List<Content>();
        
                var oneTestItem = new Content { ContentPath = "questions/tagged/excel", ContentTitle = "any text" };
                forExample.Add(oneTestItem);
        
                for (int i = 0; i < forExample.Count; i++)
                {
                    ws.Cells[1, 2] = "any text";
        
                    int range1 = i + 4;
                    var range = ws.get_Range("C" + range1, "C" + range1);
        
                    Microsoft.Office.Interop.Excel.Hyperlink link = (Microsoft.Office.Interop.Excel.Hyperlink)
                    ws.Hyperlinks.Add(range, "http://stackoverflow.com/" + forExample[i].ContentPath, Type.Missing,
                                      "Any Tooltip text!!!! e.g(http/://stackoverflow.com/forExample[i].ContentPath)",
                                      forExample[i].ContentTitle);
                }
            }
        
        class Content 
        {
            /// <summary>
            /// That is a Content Title (e.g: oneArticle)
            /// </summary>
            public string ContentTitle { get; set; }
        
            /// <summary>
            /// That is a Content link (e.g: http://stackoverflow/questions )
            /// </summary>
            public string ContentPath { get; set; }
        }
        

        【讨论】:

          猜你喜欢
          • 2012-02-16
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-09-30
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多