Hello
I have a calc book that sends a email.
The procedure is ready and the email goes out with recipient, subject and body already working.
But i want to include the String of a cell in the subject and i don´t know how?
The subject is like this
"Envio folha encomendas"&" "&"de"&xxxxxxxx&" "&"enviada em"&" "&Day(basDate)&"/"&Month(basDate)&"/"&Year(basDate)
I want to place the string of the cell in the xxxxxx position
By the way the cell is this
Dim oSheet : oSheet = ThisComponent.Sheets.getByIndex(1)
Dim oCell : oCell = oSheet.getCellByPosition(1,0)
Many thanks
Manuel
[Solved] Get String from cell to String of text
[Solved] Get String from cell to String of text
Last edited by Nelomf on Mon Apr 19, 2021 2:01 pm, edited 1 time in total.
Openoffice 4, Windows 7
Re: Get String from cell to String of text
Does oCell.string not do what you want? See viewtopic.php?f=20&t=7915
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.14
LibreOffice 7.4.4.2; SlackBuild for 7.4.4 by Eric Hameleers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.14
LibreOffice 7.4.4.2; SlackBuild for 7.4.4 by Eric Hameleers
Re: Get String from cell to String of text
I have triedrobleyd wrote:Does oCell.string not do what you want? See viewtopic.php?f=20&t=7915
dim bares as text
xSheet = ThisComponent.Sheets(1)
oCell = xSheet.getCellByPosition(1,0)
bares = oCell.string
But when i use the string in the subject text
eSubject = "Envio folha encomendas"&" "&"de"&Bares&" "&"enviada em"&" "&Day(basDate)&"/"&Month(basDate)&"/"&Year(basDate)
Gives me a syntax error
Thanks
Last edited by Nelomf on Mon Apr 19, 2021 12:35 pm, edited 1 time in total.
Openoffice 4, Windows 7
Re: Get String from cell to String of text
How are you creating the subject? I would get the string, then build the subject including the string variable.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.14
LibreOffice 7.4.4.2; SlackBuild for 7.4.4 by Eric Hameleers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.14
LibreOffice 7.4.4.2; SlackBuild for 7.4.4 by Eric Hameleers
Re: Get String from cell to String of text
I have tried
dim bares as text
xSheet = ThisComponent.Sheets(1)
oCell = xSheet.getCellByPosition(1,0)
bares = oCell.string
But when i use the string in the subject text
eSubject = "Envio folha encomendas"&" "&"de"&Bares&" "&"enviada em"&" "&Day(basDate)&"/"&Month(basDate)&"/"&Year(basDate)
Gives me a syntax error
Thanks
dim bares as text
xSheet = ThisComponent.Sheets(1)
oCell = xSheet.getCellByPosition(1,0)
bares = oCell.string
But when i use the string in the subject text
eSubject = "Envio folha encomendas"&" "&"de"&Bares&" "&"enviada em"&" "&Day(basDate)&"/"&Month(basDate)&"/"&Year(basDate)
Gives me a syntax error
Thanks
Openoffice 4, Windows 7
Re: Get String from cell to String of text
Would help if you told what the syntax error was. But for a guess:
I suspect you could also use
You may also want a space after de to separate it from the cell value you are including.
bares = oCell.string
eSubject = "Envio folha encomendas"&" " & "de" & Bares &" "&"
enviada em"&" "& Day(basDate)&"/" &Month(basDate) &"/" &Year(basDate)
Note that one variable name starts with upper case and the other with lower case.I suspect you could also use
Code: Select all
eSubject = "Envio folha encomendas"&" " & "de" & oCell.string &" "&"
enviada em"&" "& Day(basDate)&"/" &Month(basDate) &"/" &Year(basDate)
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.14
LibreOffice 7.4.4.2; SlackBuild for 7.4.4 by Eric Hameleers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.14
LibreOffice 7.4.4.2; SlackBuild for 7.4.4 by Eric Hameleers
Re: Get String from cell to String of text
Hello
Using the oCell.string result fine.
Thanks
Using the oCell.string result fine.
Thanks
Openoffice 4, Windows 7