From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a Caption to Word Image

Solved!
Go to solution

Hey everyone,

 

Does anyone know of a way to add a caption to a word image using the report generation toolbox for office? I got as far as adding a line of text before but I'm looking to instead add it as a caption underneath.

 

Thanks in advance,

 

Anthony

0 Kudos
Message 1 of 6
(3,858 Views)
Solution
Accepted by topic author AnthonyMN

Something like this will work for you.  Make sure that whatever text you put in the Label field is already added to the collection in Word, otherwise it will error out.  Word maintains a collection of these labels, which can be accessed programmatically using the Applications object and selecting the CaptionLabels property.

 

EDIT: updated image to show CaptionLabels property.

 

Example_VI_BD.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 6
(3,834 Views)

I spent most of my morning messing with ActiveX and was just not getting it. Thank you so much for this solution!

0 Kudos
Message 3 of 6
(3,814 Views)

I've implemented the procedure which was given in here but was given an Error 1 to go onto it.

 

"Possible reason(s):

LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
=========================
NI-488: Command requires GPIB Controller to be Controller-In-Charge."

 

This error occurs for me in the "Save Report to File" VI.

 

Does anybody have any advice on this? I've taken apart most of my VI to find if it's something else but for sure it's something in this section. I've tried different report names and moving the report in / error in on the Save File vi but nothing seems to be helping.

 

I've included an image with this for testing - it should take the image and plug it into a new report with the caption when run.

0 Kudos
Message 4 of 6
(3,807 Views)

Can you post a snippet of the code?  I am still using LV2012 unfortunately.  Smiley Frustrated

 

That error typically has something to do with file access, permissions, or maybe invalid save path.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 6
(3,709 Views)
Solution
Accepted by topic author AnthonyMN

@AnthonyMN wrote:

I've implemented the procedure which was given in here but was given an Error 1 to go onto it.

 

"Possible reason(s):

@Labview: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or
=========================
NI-488: Command requires GPIB Controller to be Controller-In-Charge."

 

This error occurs for me in the "Save Report to File" VI.

 

Does anybody have any advice on this? I've taken apart most of my VI to find if it's something else but for sure it's something in this section. I've tried different report names and moving the report in / error in on the Save File vi but nothing seems to be helping.

 

I've included an image with this for testing - it should take the image and plug it into a new report with the caption when run.


You are closing references to the document and application before saving the file. Do that after your save.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 6 of 6
(3,697 Views)