• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Automating Importing a Visio OLE Object or Changing the Source of a Previously Imported OLE Object

Guest
May 20, 2013 May 20, 2013

Copy link to clipboard

Copied

My colleagues and I import our Visio files into FrameMaker 10 via the following mechanism: File > Import > Object... > Create from File (with Link checked).  We do this because, for us, the benefits of object linking and embedding outweight the pitfalls. In order to institute and automate a graphic file naming convention, I want to be able to do one of the following using ExtendScript:

  • Replace each Visio OLE object with that of a renamed or new Visio file. (I've tried using the Import() method  with many different import-script settings, but have not found the correct import-script, if such a thing exists for importing Visio files  imported by reference and linked as OLE objects. My typical error when attempting this is FV_DisallowedImportType, which indicates the source file type is disallowed by my import-script settings. When I talk about my import-script settings, I'm referring to the adjustments that I make to the parameters returned from a call to GetImportDefaultParams().  I've tried numerous import-script combinations but have had no luck. )
  • Rename the Visio source file and change the source file of an already-linked Visio OLE object.  (To do this, I need to determine how to implement a script that equals the following user actions while a FM document is open: clicking on Links... under the Edit menu to bring-up the Links window; selecting each link displayed in the Links window; clicking the Change Source button for each selected link; entering the new file name in the File name field of the Change Source window; clicking Open.  Needless to say, I found nothing in the ExtendScript capabilities that indicates that this approach is doable. It may be doable using FDK F_Codes, I haven't explored that avenue and would like to avoid it.)
  • Modify the OLE2 facet such that it points to the renamed file instead of the previous name for the file.  (This does not seem like a clean approach.  As is the case now, I don't know how to properly update the facet with the new file name.  I've experimented with simply changing the file name strings from new to old, but that does not work.  There's probably some error-checking or checksum that needs to be recomputed.  Bottom line: I don't know enough about facets.)

Any help would be greatly appreciated.

Thanks, Paul

TOPICS
Scripting

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 20, 2013 May 20, 2013

Copy link to clipboard

Copied

Hi Paul,

I tried doing something like this years ago with FrameScript, but found out that the OLE stuff is not exposed to FrameScript or the FDK. So it is probably not exposed to ExtendScript either. When you query an OLE graphic's InsetFile property, it returns a null string, the same as a graphic Imported by Copy would. As far as I can see, importing as an OLE object is only available through the Windows FrameMaker interface.

Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 20, 2013 May 20, 2013

Copy link to clipboard

Copied

LATEST

Thanks for the response Rick!  The odd thing is that using the Import() method after renaming the original object's associated .vsd file does work sometimes (but not often).  I can't pin down why it works sometimes and not other times.  It's too bad this approach does not appear to be viable.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines