As a software developer, researching problems and solving problems is a requirement of our profession. To solve a problem, we want to study it and learn it, then we need to collect relevant materials and learn the knowledge involved in this problem. Only by mastering certain knowledge, we can solve the problem as soon as possible by using our reasoning, observation and thinking.
Recently studied C # operation Word footnote (footnote). Searching the web for a footnote on C # operations is minimal. My question is this: how to generate footnotes, in front of the contents of the footnote, do not generate a sequence number, or generated, can be deleted, because the previous sequence number I want to control.
In the body of the figure [2], as in front of Hello, I want to freely control the things in front of Hello World. There are two types of scenarios:
Scenario One: When generating footnotes, custom tags, insert empty symbols, this scenario is not implemented in code.
Scenario Two: Delete the [2] in front of Hello World and add your own number.
Scenario two, C # code implementation of the time, is particularly difficult, do not know how to do. I searched the internet and there was no answer at all. Then I found this piece of code in my notebook:
This. Application.ActiveWindow.ActivePane.View.SeekView = Word.WdSeekView.wdSeekCurrentPageFooter;
Word.Range ORange = this. Application.Selection.Range;
Orange.text = "1234567890";
Object stylename = "intense emphasis";
Orange.setrange (1, 5);
Orange.set_style (ref stylename);
Test, found that the code was originally used to add a footer, from the word inside the code can also be seen. The footnote (footnote) I studied was not very big. However, I tried to use the previous two lines of code, groping, modify the following:
1 WordOpt.WordApplication.ActiveWindow.ActivePane.View.SeekView = Word.WdSeekView.wdSeekFootnotes; 2 word.range oRange = WordOpt.WordApplication.Selection.Range; 3 Orange.setrange (02); 4 orange.delete ();
This enables the implementation of scenario two.
Thus, one or two of the code, the problem we study, may also have a great effect, until the problem is solved. It is worth mentioning that I was in the early collection of materials, the code fragments to keep, then I do not know whether it can be used, just feel a little related.
The second example: I made a word plugin with VSTO and my colleagues are responsible for packaging. You can install successfully on 32-bit word, but on 64-bit word, the plugin is not loaded.
My colleague asked me, how did you test 64-bit? I said I installed a 64-bit operating system and then loaded 64-bit word. In fact, this is not the answer she wanted, so I tested it locally. My husband becomes a debug file and copies the things under Debug to the virtual machine for testing. But the colleague is release packed and then tested. I build things under Debug, installation is no problem. So I release the next, and then in the direct installation of the VSTO file, reported an error, Xx.dll hash value and the calculation in the list is inconsistent, this has confused me. Later, in order to solve this problem, I opened the list file, do not know how to do. I think, debug is not a problem, so I copy the Xx.dll under Debug to release, the result is reported on the list of DLL version and the actual file DLL version inconsistent. Now, I want to look at the debug list, find out the Xx.dll information, and to my surprise, it was a different place from the release, and this place immediately caught my eye. I think this is the reason why the 64-bit is not successful. So I told her about my little discovery, and she repackaged it, and the problem was solved.
<assemblyidentity name="Samson.NoteFirst.RemoteCallInterface " version= " 1.0.0.0 " publickeytoken="b9552cfe9aef3411" language="neutral "processorarchitecture="x86 "/>
Look at the next processorarchitecture= "x86", this is not to say 32 bit?
Thus, from a point of detail, it may be possible to solve the problem directly, but the premise is how to discover this detail, on the one hand is knowledge experience, on the other hand intuition and inspiration. Inspiration is often in distress and helplessness, but has been struggling to think and pursue, like lightning flash flash. Knowledge and experience that depends on time to accumulate, straight feel good observation and insight.
A software developer's experience in solving problems--good at using clues