Finding origin extension - vba

I'm just starting my adventure with programming and VBA and now I have small problem. Sometimes people change extension of files (they have some reasons) but I need to find extension before changing.
For example: first it was doc , then docm, then odt (or pdf, etc.) and I need to find that it was doc at the beginning. I don't know if it's possible.
I thought that if I open file in notepad there is some kind of code in it, and probably part of code may be "origin" extension, but which part is it? Or is there some other way I could use in VBA?

Please Look into #Tim Williams comments, it is not prudent to try to find origin's extension as many a times files are saved in different file formats. However various approaches for keeping track of file version and history of the files are mentioned here-under.
There are some tools(example-XLTools) and processes that will allow you to see the revisions of an Excel sheet. As far as a revision history within the Excel sheet, you will not have any unless you have set this up yourself. There is not a built in change history for Excel. Otherwise File History regularly backs up versions of your files in the Documents, Music, Pictures, Videos, and Desktop folders and the OneDrive files available offline on your PC. Over time, you'll have a complete history of your files. If the originals are lost, damaged, or deleted, you can restore them. You can also browse and restore different versions of your files. For example, if you want to restore an older version of a file (even if it wasn't deleted or lost), you can browse through a timeline, select the version you want, and restore it.
If your files are uploaded to SharePoint and If a list or library on your site tracks versions, you can view version history for items or files, providing you have Read permission to the list or library. The version history contains information about when the item or file was changed, who changed it, and information about what was changed. In libraries, the version history might also contain comments written by the people who made changes.
You can view version history in either of two ways:
In the list or library on your site
In the Microsoft Office Backstage view of a Microsoft Office 2010 document. You can also track changes if you upload to DropBox Or say Box, there also revision history and version changes can be tracked.

Related

How to retrieve files in Domino Web documents to embed them instead of showing them as links?

I have a Notes app that was designed for the browser, not the client. It allowed upload of files into the documents, so nearly all the documents have files. The files are stored in the NSF as $FILE and displayed in the documents as links.
I am using Adobe Acrobat Pro to create PDFs from the documents and need to include the file attachments within the PDFs, however the PDFs just include links to the files, not the attachments. Can I write an agent to run against the documents to get those files and embed them within the documents? When I view those documents through the client, I see all of the HTML etc. and then at the bottom of the document, the file attachments appear. When I view these same documents in the browser, the file attachments do not appear. If I could merely ensure that they are there, then when running the PDF generator in Acrobat Pro, they would be included in the PDFs and executable.
I am really stuck here, with no other way to 'archive' this notes database with all the data intact.
Thanks in advance for any insights!!
Ginni
There is a commercial product from Swing Software that does this. I hear that it's quite good, but I've never used it. Let me explain why...
The way I usually end up doing this is just quick-and-dirty. I write an agent to export the files, using the document UNID as part of the filename. The same agent exports all the data fields from the document into a CSV file, and I add a column with the filename of the extracted attachment. In your case, I would add two columns -- one for the extracted attachment(s), and one for the generated PDF. The CSV serves as an index for the exported data. It can be imported into something more friendly, or just left as-is and brought up in Excel, depending on the customer's usage requirements and available systems. I've recommended Swing Software's product and offered to explore other ideas for developing code (e.g., using wkhtmltopdf for Domino web apps to capture a WYSIWYG rendering based on an HTML crawl) for PDF rendering of Notes documents for a couple of clients, but none of them have justified the cost that would be involved in buying licenses and/or writing the code. Quick and dirty always seems to win, even when there are retention and eDiscovery considerations taken into account.

How do I convert a Google Doc for alternate cloud storage, with revision history intact, to a openable document in Dropbox

Is there a way to do this easily? Keep version history of the document on the document? As a .gdoc or .whatever-format or am I resigned in having to download, separately, all the revisions made in the past on said document?
For context: I have a document I've been editing and revising over the years for my own medical history and list of meds, history, etc. etc. and have been using Google Docs to do this, because it was convenient and I didn't have to pay for Microsoft Office and additionally install a good word processor on my PC. Now recently I've purchased Dropbox Personal for cloud storage needs.
I want to do the following: Take the Google Doc and save it as a .gdoc (which isn't an option in the File menu??) and take it over to Dropbox's Vault as an editable hardcopy with its revisions history in tact.
Otherwise, what I have done (before I even comprehended revision history was a thing) is just copy pasted its current version, onto a new .gdoc in Dropbox Vault.
So, is that possible? And if so, how and as easily (lazily) as I possibly can? Also, is this even the right place to ask for this? Apologies if it isn't. I didn't see much else about this specific issue anywhere... (also lazy)
Thanks!
EDIT:
I am by no means a coder in any sense. I'm a full time elderly caretaker and I'm just a guy with a specific, niche?, technical, problem and thought this was the first place to ask without having to go through tech support w/ Google chat etc. And it might also help some other people that like seeing how their documents have changed over the years, history fans etc. At the end of the day it's a programming/coding issue, that could be resolved someway some how... Right?
If I can add pictures here for context, LMK.
Thanks :)
The .gdoc file format is only accessible via Google Docs which is on web. Downloading the file to your local storage means you would have to access it on your device using your local apps (word editor) such as Microsoft Office,Libre Office, etc.(other word editor apps on desktop application level) which is why the .gdoc format is not available when you download. This is also why you won't be able to have it openable from your dropbox.
The version/revision history on Google Docs is intact only to that specific file with that unique ID. So when you download the file, the version history won't be available to the physically downloaded file which is stored on web or even when you make a copy of it, the version history does not get copied, therefore that won't be an option too.
It looks like you'll have to stick to manually copying or making a backup of the current version of the file before editing, since the version history is only kept for a period of 30 days or the last 100 versions, unless manually set to "Keep forever" to keep a version forever.
Google drive version history: https://googledrivepro.com/google-drive-version-history/

How to make files accessible to all users on Visual Basic app

I am attempting to make an instructional app for the call canter that I work at. Part of the code allows users to display information through the use of several files in our directory with drop down combo boxes.
For instance, a small portion of the code is similar to this (I did not save the app and bring it home so I am going off memory):
If cboGlossaryTerm.SelectedItem("MSN")Then
Process.Start("S:\MSN.pdf")
End If
I put the pdf files in My Resources and the Word files are added under the Solution folder.
I am using filepaths in the code as well.
(I attempted to save the pdf files in the Solutions folder but the pdf was not compatible.
With me adding the files this way, will users who do not have access to the S drive folder be able to display the files? Also, will the files remain accessible in the program if they are deleted from the S drive? If not, how should I be referencing the files in my project? Do I have to reference the pdf files from My Resources? If so, how do I do that in an If-Then statement similar to the one above?
from what you have there it doesn't look like the pdfs in the S:\ would be available to anyone who doesn't have the drive mapped on their local machine.
as for if the files are deleted, if they are being loaded from the S:\ then when they are deleted from there the program will not be able to find them to load them.
if the program is being installed on the local machines you might want to look at just including the pdfs in the installer and accessing them through the program files path.

Prevent file being overwritten

Imagine there are 3 or more independent locations where a file can be modified. These locations communicate to each other through email or mail (direct flash drive restoration). Though there is a big room for flow - to make simultaneous editing to the file and screw up things, this client won't change too much. He rather call everyone that he is working on the last update or tell the other guys that he is waiting for third guy's last update. Anyway, at some point after several exchanges, due to one of participants unintentional error THE LAST VERSION of the file eventually gets mixed up. From this point everyone searches for the last version BY LOOKING THE CONTENT of the file.
This client wants to have a central location (he has actually, that is his PC's some location) and let everybody (including himself) copy any new or suspected new file to this location but prevent file's last version being copied. From this location he has to easily copy, send or open the file and work.
So, here is my concept (2 steps):
step 1: I made an ad to the main application where this file is created or edited. This ad prompts the user to give a version number to the file with every invoked save command from the editing application. In fact the file can be re-saved multiple times but not considered modified (file attributes creation, save etc. do not have great meaning here). This said the user can cancel my ad-in but have saved the file, not saving a new file version.
step 2: multiple solutions:
solution A: I'm thinking to have a folder/file watch and prevent the last version of the file being overwritten. As you know, FileSystemWatcher will fire the change/delete etc., events AFTER FACT so, I have to back copy overwritten file after the fact (w/ some tricks).
solution B: have a database to store all version of files and built-in some shell extension to extract/view files from the database. Move all copied/pasted files to the database (my program folder) and restore latest file in working folder after watcher fires change/delete event.
solution 3: find out built-in windows tools (API etc.) to greatly rely on it with some programming.
Any ideas?
Thanks in advance.

property promotion in infopath and sharepoint 2010

I have a SharePoint 2010 document library with >7000 xml documents created from infopath forms(Infopath 2007). Now i would like to promote few fields in the form to the SharePoint document library. I could do this only for documents created from the upgraded form, but not for all previously created documents. Although re submitting of old forms will work,It is not possible for me to update all 7000 records to promote the values to the column. Is there a much easier solution, considering the fact that this changes need to be implemented on a production environment too.
Note:The promoted columns will be used to generate graphical report. Any solution acceptable.
I've been through this before, and there's no good answer. If I understand correctly, you have existing InfoPath forms in a doc library, and you now want to promote fields to the document library, but you don't want to open each form one by one, correct?
Note, you most likely don't have to open then re-submit each form, you just have to open the form, and close it. Once you do that, the promoted fields will them show up.
So... what I've done before is this: First, get notepad++ (this allows you to open multiple files in tabs). Secondly, access the the doc library via WebDav (that is, go to the library in SharePoint, then go to the Library tab, and click Open with Explorer). Thirdly, open a large batch of files at once using notepad++ (select files, right-click, open with notepad++). It will take a moment for all the files to load in notepad++ in tabs. Once they are all open in notepad++, hit ctrl-w as fast as you can (which closes each file). Rinse and repeat.
It's not pretty, and I'm sure there's a better way to do this (programatically, perhaps), but this should work. At least you won't have to open each form one by one.
You can do this by relinking the document by powershell or through advanced settings.