Question How to insert a hypertext link in c #

cmd

New member
Joined
Apr 17, 2023
Messages
4
Programming Experience
Beginner
I work on a project in C# Windows App and it asks me to import a list of Excel names this part I already reusi but I am stalling at the level where the list of names that I am going to import must ensure that if I click on a name that cq can bring me back to a pdf page or word aui displays the information of the person.
I really need your help I am waiting for your answers please
 
Last edited by a moderator:
Import to where? Click on what? Please provide more specific details of exactly what you're doing and exactly what you want to happen.

IS
Import to where? Click on what? Please provide more specific details of exactly what you're doing and exactly what you want to happen
i work on windows app but i must import a list sheet excel in my app but what i want to happen it's if i click on one name i want to be send in a other page contain a pdf or a doc word (sorry for my english but i need your helpe please)
 
C#:
Microsoft.Office.Interop.Excel.Application MonApp = new Microsoft.Office.Interop.Excel.ApplicationClass();

MonApp.Visible = true;

Microsoft.Office.Interop.Excel.Workbook Classeur = MonApp.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);

Microsoft.Office.Interop.Excel.Worksheet Feuille = (Microsoft.Office.Interop.Excel.Worksheet)Classeur.Worksheets.get_Item(1);

Microsoft.Office.Interop.Excel.Range MaCell = (Microsoft.Office.Interop.Excel.Range)Feuille.get_Range("A1", "A1");

Feuille.Hyperlinks.Add&#40;MaCell, "http&#58;//<a href="[URL='http://www.developpez.com']Developpez.com, le club des développeurs et IT Pro[/URL]"," target="_blank">[URL='http://www.developpez.com']www.developpez.com[/URL]",</a> System.Reflection.Missing.Value, System.Reflection.Missing.Value, "Developpez"&#41;;
please i found this code somewhere but without explanation is this code could be userful to me for my question? and if so please inform me how to proceed please because my application asks me to import an excel file which contains a list of names then once the import is finished if i clicj on a name it should bring me back on a pdf page or a word file that contains the person informations please i really need your helf for this i am newbie in c#
 
Last edited by a moderator:
That code that you found is not even valid C# code. It looks like it has some characters that have been HTML encoded that need to be decoded.

But even if you got the original characters correctly, it is not the code that you are looking for. What that code does is insert hyperlinks into a running Excel application. It does not insert hyperlinks into your C# Windows app.
 
That code that you found is not even valid C# code. It looks like it has some characters that have been HTML encoded that need to be decoded.

But even if you got the original characters correctly, it is not the code that you are looking for. What that code does is insert hyperlinks into a running Excel application. It does not insert hyperlinks into your C# Windows app.

and you dont know how to help me then to solve this problem? what should i do which code used please i really need your help team
 
If you are using WinForms:

But you still have failed to provide sufficient details about your code and your problem. We don't even know what framework (if any) you are using, what platform you are targeting, or what resources are available.
 
Back
Top Bottom