How to navigate to specific contents of madcap flare's document from vb.net code? - vb.net

We have been using PDF file as a part of help docs in our vb.net desktop application. In PDF, we would traverse to the certain chapter in the PDF doc.
Now we have decided to use MadCap Flare as documentation tool. We have a menu item in vb.net form for documentation. On click of the link, we want to open the specific chapter of the Flare documentation.

You know managing content with single-source XML authoring is possible when using MapCad Flare (I'm not using Flare!). You can publish content to an increasing number of formats including HTML5, WebHelp, PDF, Word, XHTML, Clean XHTML, EPUB, DITA and more by MapCad Flare.
So, you may continue using PDF and the way connecting your vb.net desktop application help.
Using HTML based topics maybe another solution for your needs by creating Help for a form, a dialog or control with HTML files (See also: Help for controls with VB .NET).
Properties to display help (HTML file - local)
Activate the hlpProvider component hlpHtmlLocal and set the HelpNameSpace property of hlpHtmlLocal to the file name you want to work with.
We open a local HTML file with the dialog using the little button to the right.
The next step is to set the HelpNavigator property of a control (e.g. button) to a value of the HelpNavigator enumeration (see table below). Here we use Topic.
When the application is running click the HelpButton to enable "What's this .." Help. The cursor changes. Now click the button or press F1 when the button has focus. This will open the single HTML file in your browser.
It seems you can't use anchor names to jump to a specific part of your HTML file.
Properties to display help (HTML file - Server http://..)
Activate the hlpProvider component and set the HelpNameSpace property of hlpHtmlServer to the file name you want to work with. Here we use a http:// address of a single HTML file. If you provide the file on your company server, you don't have to update the help file with the customer.
The next step is to set the HelpNavigator property of a control (e.g. button) to a value of the HelpNavigator enumaration (see table below). Here we use Topic. Then we set the HelpKeyword on hlpHtmlSever property to e.g. "anchor3". Don't add a leading "#". Leave it empty if you want to open a HTML file without anchors. The Help Handles cmdControl2.Click Dim sHelpFile As String Dim sStartupPath As String '--- Initialize context-sensitive help --- Keyword property provides the key information to retrieve the help associated with the control.
When the application is running click the HelpButton to enable "What's this .." Help. The cursor changes. Now click the button or press F1 when the button has focus. This will open the single HTML file over the Internet in your browser.

Related

How to edit a Word document that opens in read-mode in VBA

I am editing Word documents I get from clients with VBA, and the clients often give them to me in an 'uneditable view'. Thus, I would like to 'enable editing' in within my macro before doing my tasks.
Note that I did not say the document is in 'read-only' as I do not think it is (I do not see the [read only] text in the document title bar when I open it manually). I have also tried setting readOnly=false as described in this post, but it did not make a difference to how the document opened. what I am seeing when I open the document manually is a '2-page view' with arrows on the sides to page forward/back, and when I try to edit the document I see a status message in the lower-left corner of the document's frame: This modification is not allowed because this document is opened for viewing only. I can manually make the document editable by going to View > Edit Document.
I spent a while searching for this one as I didn't know the view was called 'read-mode', so I thought it was worth sharing. My strategy was to 'toggle off read-mode' once I opened my document with this line:
ActiveDocument.ActiveWindow.View.ReadingLayout = False
REF: https://msdn.microsoft.com/en-us/vba/word-vba/articles/view-readinglayout-property-word

PDF Markers visible on Document

Is there a way to add a marker on to a PDF that is not contained within the Bookmark panel and visible on the PDF itself. So that our client can just click on the marker to bring him to a specific point in the document. These will be changes that are revisions and not necessarily to do with the structure of the document. I feel like I have seen this in the past but unsure how to go about creating it. Any advisement you may have to offer is greatly appreciated.
I am running AA XI Pro.
Thank you,
You can create floating toolbar using the code below as an example. cExec is the JavaScript expression string to evaluate when the button is clicked. oIcon, which is optional, is a document level icon that you would have previously added to the document using...
this.addIcon("iconName", "iconPath");
You can just run the code to add the icon from the console since you only need to do it once.
Add the code below to a Document JavaScript so that it loads every time the document is opened.
app.addToolButton({
cName: "goToPage",
oIcon: util.iconStreamFromIcon(this.getIcon("LinkIcon")), // Needs to already be a document level Icon object in the document
cExec: "this.pageNum=41",
cTooltext: "Got To Page 42",
cEnable: true,
});
You can add as many buttons as you like but each cName needs to be unique. Also, This will only work in the desktop versions of the Adobe viewers.
You can find a working example of the code above here

No Access to Template's Document

I have an existing Macro Enabled Template which I would like to add Content Control to, to be available on the screen when the Template is accessed.
I know how to add the Content to a Word Document and then save it as a Template. The problem is that I cannot view the Exisiting Template's Word Document due to the view Object being greyed out. See below:
I really do not want to copy all my Macros and my quick texts over to a new document just to add one line of text and a button.
I can easily add the required text and CommandButton by having a script run in a Document_New Sub under the ThisDocument. The problem is that this Sub bombs out due to Macros not being enabled. I intend to have the Template distributed to numerous colleagues, therefore having the Text and button on the document will avoid any confusion as to what to do with the template.
You need to open the Template via File - Open
Opening the Template this way will display give you access to the Template.
For info: The name of the Template will appear in the Center of the Word Application.

How to open word file in background using vb.net?

I am working on creating multiple documents from source document.
I am using:
objWordApp.Documents.Open("D:\Template\Aptletter.doc")
I modify the above document and save in another folder.
While creating documents, word files are opening and closing multiple times. So user unable to do another work on the same PC.
How to stop open file or Is there any method to modify document without above method?
So please suggest
Thanks in Advance
DEV
The visibility of a word document being controlled via interop can be set using the WordApplication.Visible attribute.
This attribute is, as you can see, at the Application level. If you've already opened a document using that WordApplication, you can't suddenly make the application invisible using the attribute.
What you can do, though, is create another instance of WordApplication. Call it InvisibleWordApplication for clarity, and set InvisibleWordApplication.Visible = false right from the start. Then open your document using that application, and you should be set.

How to make sure users can only download file from the attachment control but not be able to upload or remove it

I'd like to create a read-only view in the infopath.However when I disable the attachment control ,user can not download the file at all.How to make sure users can only download file from the attachment control but not be able to upload or remove it.
If you are customizing a SharePoint List form, you will not be able to set the File Attachment control to read only. However, I was able to work around this, and this will work for you even if it's just a regular form, by using repeating sections with hyperlink controls inside.
In the Fields pane, click on Show Advanced View
Expand Attachments so you can see the attachmentURL field
Drag attachmentURL into the form and choose Repeating Section with Controls
Click in the section and press CTRL-K to insert a Hyperlink
Enter . in Data Source for Link to
Enter . in Data Source for Display
There are some gotchas and workarounds for some problems you may encounter. See more details on my blog post http://vincepangan.com/?p=220
context menu -> Properties, there is a check box (the first one) on the first tab, make sure it is not checked.
EDIT: If your view is read-only, you cannot download the attachment. The workaround is to clear the read-only checkbox of the view, and activate the read-only on all other controls. The attachment control can be configured to not allow upload/modification of the attachment. This means that in order to upload or modify an attachment, you'll need an other view.
See also entries on msdn:
http://social.msdn.microsoft.com/Forums/en/sharepointinfopath/thread/1106f090-7767-431f-a699-b81c1173c2ee
http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/36c07bd7-a5ba-4fa0-b992-e9a94103dbf4
http://social.technet.microsoft.com/Forums/sr-Latn-CS/sharepoint2010customization/thread/412e80ce-badb-4467-a2d1-7e1696774058